Wed 20 Jul 2005 04:32:12 PM UTC, comment #3:
There need to be several things present in order to let MLDonkey
use threads:
Buildinfo uses:
if BasicSocket.has_threads () then " threads" else " no-threads"
in basicSocket.ml there is this code:
external has_threads : unit -> bool = "ml_has_pthread"
which is used in ./src/utils/lib/stubs_c.c:
#if !defined(HAVE_PTHREAD) || !(HAS_GETHOSTBYNAME_R || GETHOSTBYNAME_IS_REENTRANT)
...
value ml_has_pthread(value unit)
{ return Val_false; }
#else
...
value ml_has_pthread(value unit)
{ return Val_true; }
#endif
In ocaml/caml/config.h I have this line on Linux:
#define HAS_GETHOSTBYNAME_R 6
GETHOSTBYNAME_IS_REENTRANT is used for Windows systems (code from stubs_c.c):
#ifdef _WIN32
#define GETHOSTBYADDR_IS_REENTRANT 1
#define GETHOSTBYNAME_IS_REENTRANT 1
#endif
So, in order for the core to recognize threads properly two things
must be present on your non-Windows system:
mldonkey/config/config.h
/* Define if you have POSIX threads libraries and header files. */
#define HAVE_PTHREAD 1
and
In ocaml/caml/config.h I have this line on Linux:
#define HAS_GETHOSTBYNAME_R 6
from Ocaml sourcecode, config/s-templ.h
#define HAS_GETHOSTBYNAME_R 6
/* Define HAS_GETHOSTBYNAME_R if gethostbyname_r() is available.
The value of this symbol is the number of arguments of
gethostbyname_r(): either 5 or 6 depending on prototype.
(5 is the Solaris version, 6 is the Linux version). */
Either one of this is missing on your system. Please let me know what.
|