This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

_POSIX_THREADS


< subject changed from re Python >

Robert Collins writes:
>
>Yes but. _POSIX_THREADS should not be defined.
>*** IMPORTANT: Can you see if you can find where it's getting defined?
>*** AFAICT It's only meant to be defined by the system headers to
>indicate system conformance. 

Hmm...   IMHO this is a bit of a chicken egg situation
_POSIX_THREADS is being set by the Python configure 
mechanism which correctly determines that the system has 
pthread_create() and then, in this case incorrectly, assumes 
that this is a _POSIX_THREADS system

perhaps we should rename the Cygwin threading module
cygthread if in fact Cygwin threading is not going to be
_POSIX_THREADS compliant to avoid this confusion.
	
To me It seems as if pthread_XXX implies _POSIX_THREADS

What actually sets this is the configure test below
which seems to just work for all other systems.

Cheers

Norman Vine

if test "$with_threads" = "no"
then
    USE_THREAD_MODULE="#"
else
    if test ! -z "$with_threads" -a -d "$with_threads"
    then LDFLAGS="$LDFLAGS -L$with_threads"
    fi
    if test ! -z "$withval" -a -d "$withval"
    then LDFLAGS="$LDFLAGS -L$withval"
    fi
    AC_DEFINE(_REENTRANT)
    AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD)
    AC_DEFINE(C_THREADS)
    LIBOBJS="$LIBOBJS thread.o"],[
    AC_MSG_CHECKING(for --with-pth)
    AC_ARG_WITH(pth,
    [  --with-pth                      use GNU pth threading libraries], [
    AC_MSG_RESULT($withval)
    AC_DEFINE(WITH_THREAD)
    AC_DEFINE(HAVE_PTH)
    LIBS="-lpth $LIBS"
    LIBOBJS="$LIBOBJS thread.o"],[
    AC_MSG_RESULT(no)
    AC_CHECK_LIB(pthread, pthread_create, [AC_DEFINE(WITH_THREAD)
    AC_DEFINE(_POSIX_THREADS)
    LIBS="-lpthread $LIBS"
    LIBOBJS="$LIBOBJS thread.o"],[
    AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD)
    case $ac_sys_system in
      Darwin*) ;;
      *) AC_DEFINE(_POSIX_THREADS);;
    esac
    LIBOBJS="$LIBOBJS thread.o"],[
    AC_CHECK_HEADER(kernel/OS.h, [AC_DEFINE(WITH_THREAD)
    AC_DEFINE(BEOS_THREADS)
    LIBOBJS="$LIBOBJS thread.o"],[
    AC_CHECK_LIB(pthreads, pthread_create, [AC_DEFINE(WITH_THREAD)
    AC_DEFINE(_POSIX_THREADS)
    LIBS="$LIBS -lpthreads"
    LIBOBJS="$LIBOBJS thread.o"], [
    AC_CHECK_LIB(c_r, pthread_create, [AC_DEFINE(WITH_THREAD)
    AC_DEFINE(_POSIX_THREADS)
    LIBS="$LIBS -lc_r"
    LIBOBJS="$LIBOBJS thread.o"], [
    AC_CHECK_LIB(thread, __d6_pthread_create, [AC_DEFINE(WITH_THREAD)
    AC_DEFINE(_POSIX_THREADS)
    LIBS="$LIBS -lthread"
    LIBOBJS="$LIBOBJS thread.o"], [
    AC_CHECK_LIB(pthread, __pthread_create_system, [AC_DEFINE(WITH_THREAD)
    AC_DEFINE(_POSIX_THREADS)
    LIBS="$LIBS -lpthread"
    LIBOBJS="$LIBOBJS thread.o"], [
    AC_CHECK_LIB(cma, pthread_create, [AC_DEFINE(WITH_THREAD)
    AC_DEFINE(_POSIX_THREADS)
    LIBS="$LIBS -lcma"
    LIBOBJS="$LIBOBJS thread.o"],[
    USE_THREAD_MODULE="#"])
    ])])])])])])])])])

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]