diff --git a/src/daemon/driver/driverInteractive.ml b/src/daemon/driver/driverInteractive.ml index 28774198..1f601f59 100644 --- a/src/daemon/driver/driverInteractive.ml +++ b/src/daemon/driver/driverInteractive.ml @@ -1911,7 +1911,7 @@ let buildinfo html buf = tack list ( "Features:\t", - (if BasicSocket.has_threads () then " threads" else " no-threads") ^ + " threads" ^ (let s = Zlib2.zlib_version_num () in Printf.sprintf " zlib%s" (if s <> "" then "-" ^ s else "")) ^ (if Autoconf.bzip2 then diff --git a/src/networks/donkey/donkeyShare.ml b/src/networks/donkey/donkeyShare.ml index 7a0fffb8..06f20662 100644 --- a/src/networks/donkey/donkeyShare.ml +++ b/src/networks/donkey/donkeyShare.ml @@ -272,8 +272,7 @@ let rec check_shared_files () = job_creater (); (* only try back-to-back hashing if hashing is handled by a separate thread *) - if BasicSocket.has_threads () then - check_shared_files () + check_shared_files () ) with Wrong_file_size (real,computed) -> diff --git a/src/utils/lib/stubs_c.c b/src/utils/lib/stubs_c.c index 295f33e7..73d7273c 100644 --- a/src/utils/lib/stubs_c.c +++ b/src/utils/lib/stubs_c.c @@ -21,7 +21,9 @@ #include #include - +#include +#include +#include #ifdef __MORPHOS__ #include @@ -680,8 +682,7 @@ value ml_setlcnumeric(value no) #define NETDB_BUFFER_SIZE 10000 -#if defined(_WIN32) || ( defined(__FreeBSD_version) && ( ((__FreeBSD_version >= 504102) && (__FreeBSD_version < 600000)) || (__FreeBSD_version >= 600029) ) ) -#define GETHOSTBYADDR_IS_REENTRANT 1 +#if defined(_WIN32) || defined(__CYGWIN__) || ( defined(__FreeBSD_version) && (__FreeBSD_version >= 600029) ) #define GETHOSTBYNAME_IS_REENTRANT 1 #endif /* _WIN32 */ @@ -738,12 +739,12 @@ static int ml_gethostbyname(char *hostname) #else #ifdef GETHOSTBYNAME_IS_REENTRANT enter_blocking_section(); -#endif /* GETHOSTBYNAME_IS_REENTRANT */ +#endif hp = gethostbyname(hostname); #ifdef GETHOSTBYNAME_IS_REENTRANT leave_blocking_section(); -#endif /* GETHOSTBYNAME_IS_REENTRANT */ -#endif /* HAS_GETHOSTBYNAME_R == 5 */ +#endif +#endif if (hp == (struct hostent *) NULL) return 0; @@ -777,40 +778,6 @@ static value addr_list_of_job(void) CAMLreturn(v_addr_list); } -#if (!(HAS_GETHOSTBYNAME_R || GETHOSTBYNAME_IS_REENTRANT) && !defined(HAS_SIGWAIT)) - -value ml_ip_job_start(value job_v) -{ - CAMLparam1(job_v); - - char *hostname = String_val(Field(job_v,0)); - if(ml_gethostbyname(hostname)){ - Store_field(job_v, 1, addr_list_of_job()) - Store_field(job_v, 2, Val_false); - } else { - Store_field(job_v, 2, Val_true); - } - CAMLreturn(Val_unit); -} - -value ml_ip_job_done(value job_v) -{ - return Val_true; -} - - -value ml_has_pthread(value unit) -{ - return Val_false; -} - -#else /* (!(HAS_GETHOSTBYNAME_R || GETHOSTBYNAME_IS_REENTRANT) && !defined(HAS_SIGWAIT)) */ - -#include -#include -#include -#include - static int thread_started = 0; static int volatile ip_job_done = 1; #define JOB_HOSTNAME_SIZE 256 @@ -917,13 +884,6 @@ value ml_ip_job_start(value job_v) return Val_unit; } -value ml_has_pthread(value unit) -{ - return Val_true; -} - -#endif /* (!(HAS_GETHOSTBYNAME_R || GETHOSTBYNAME_IS_REENTRANT) && !defined(HAS_SIGWAIT)) */ - /******************************************************************* diff --git a/src/utils/net/basicSocket.ml b/src/utils/net/basicSocket.ml index f346618b..991085ef 100644 --- a/src/utils/net/basicSocket.ml +++ b/src/utils/net/basicSocket.ml @@ -100,7 +100,6 @@ external get_fd_num : Unix.file_descr -> int = "ml_get_fd_num" "noalloc" external select: t list -> float -> unit = "ml_select" external use_poll : bool -> unit = "ml_use_poll" -external has_threads : unit -> bool = "ml_has_pthread" external setsock_iptos_throughput: Unix.file_descr -> int = "ml_setsock_iptos_throughput" @@ -135,7 +134,6 @@ let loop_delay = ref 0.005 let socket_keepalive = ref false let verbose_bandwidth = ref 0 let bandwidth_second_timers = ref [] -let use_threads = ref true (*************************************************************************) diff --git a/src/utils/net/basicSocket.mli b/src/utils/net/basicSocket.mli index 6fb91e7a..a3c2b80b 100644 --- a/src/utils/net/basicSocket.mli +++ b/src/utils/net/basicSocket.mli @@ -104,8 +104,6 @@ val string_of_date : int -> string val date_of_int : int -> float val normalize_time : int -> int -val use_threads : bool ref -external has_threads : unit -> bool = "ml_has_pthread" val get_rtimeout : t -> float * float val int64_time : unit -> int64 val current_time : unit -> float diff --git a/src/utils/net/ip.ml b/src/utils/net/ip.ml index 30d758af..75528649 100644 --- a/src/utils/net/ip.ml +++ b/src/utils/net/ip.ml @@ -329,8 +329,6 @@ let _ = exn_log "ip_fifo immediate" f ip with Not_found -> (* lprintf "resolving name...\n"; *) - if !BasicSocket.use_threads && - BasicSocket.has_threads () then let job = { handler = exn_log "ip_fifo handler" f; err_handler = exn_log "ip_fifo err_handler" ferr; @@ -340,11 +338,6 @@ let _ = } in current_job := Some job; job_start job - else begin -(* lprintf "from_name ...\n"; *) - exn_log "ip_fifo no threads" f (from_name name) - - end ) | Some job -> if job_done job then begin