delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/03/27/16:36:36

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Reply-To: <nhv AT cape DOT com>
From: "Norman Vine" <nhv AT cape DOT com>
To: "'Robert Collins'" <robert DOT collins AT itdomain DOT com DOT au>, <cygwin AT cygwin DOT com>
Subject: _POSIX_THREADS
Date: Tue, 27 Mar 2001 15:14:43 -0500
Message-ID: <008c01c0b6fa$9072dd60$a300a8c0@nhv>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2232.26
In-Reply-To: <021101c0b6cf$4da8af80$0200a8c0@lifelesswks>
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200

< 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019