[Ecls-list] Macos X and threads
bernard tatin
bernard.tatin at tele2.fr
Wed Jan 26 03:00:00 UTC 2005
Hello,
I made :
./configure --enable-threads && make
I get 1 compilation error in package.d and 2 in threads.d. gcc complains
about the 2 constants PTHREAD_MUTEX_ERRORCHECK_NP and
PTHREAD_MUTEX_RECURSIVE_NP. I made :
#if defined(__APPLE__)
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
#else
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK_NP);
#endif
and :
#if defined(__APPLE__)
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
#else
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
#endif
After that, the compilation was succesfull and after the installation I
get :
[LeMac:ecls-thread] narberd% ecl
ECL (Embeddable Common-Lisp) 0.9e
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2000 Juan J. Garcia-Ripoll
ECL is free software, and you are welcome to redistribute it
under certain conditions; see file 'Copyright' for details.
Type :h for Help. Top level.
> *features*
(:NEW :DARWIN :IEEE-FLOATING-POINT :CLOS-STREAMS :CMU-FORMAT :BSD
:DLOPEN :CLOS
:THREADS :BOEHM-GC :ECL :COMMON :ANSI-CL :COMMON-LISP :POWERPC7450)
>
Here :
http://www.die.net/doc/linux/man/man3/pthread_mutexattr_settype.3.html,
it is said that the _NP suffix means :
'non-portable extension to the POSIX standard and should not be employed
in portable programs'. I think my correction does not change the behavior.
Note :
I don't know if #if defined(__APPLE__) works on Darwin. I made :
gcc -dM -E - < /dev/null
to see the predefined constants. There is also __MACH__ which works
fine. I don't know which is the best.
Great question :
If somebody can send me a full test of the thread, I would be happy !
A bientôt,
Bernard.
More information about the ecl-devel
mailing list