Mercurial > cpython-lru_cache-weakref
diff Python/thread_pthread.h @ 3663:07164d30429d legacy-trunk
Got rid of florida hack and made it work with Solaris 2.5 pthreads.
Wonder if this will break it on all other platforms :-)
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 11 Jun 1996 18:32:18 +0000 |
| parents | e4588404fdff |
| children | 9c05ff6fb0a4 |
line wrap: on
line diff
--- a/Python/thread_pthread.h Tue Jun 11 15:11:34 1996 +0000 +++ b/Python/thread_pthread.h Tue Jun 11 18:32:18 1996 +0000 @@ -22,23 +22,14 @@ ******************************************************************/ -#ifdef sun -#define FLORIDA_HACKS -#endif +/* Posix threads interface */ -#ifdef FLORIDA_HACKS -/* Hacks for Florida State Posix threads implementation */ -#undef _POSIX_THREADS -#include "/ufs/guido/src/python/Contrib/pthreads/src/pthread.h" +#include <stdlib.h> +#include <pthread.h> + #define pthread_attr_default ((pthread_attr_t *)0) #define pthread_mutexattr_default ((pthread_mutexattr_t *)0) #define pthread_condattr_default ((pthread_condattr_t *)0) -#define TRYLOCK_OFFSET 1 -#else /* !FLORIDA_HACKS */ -#include <pthread.h> -#define TRYLOCK_OFFSET 0 -#endif /* FLORIDA_HACKS */ -#include <stdlib.h> /* A pthread mutex isn't sufficient to model the Python lock type * because, according to Draft 5 of the docs (P1003.4a/D5), both of the @@ -78,16 +69,13 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg) { -#if defined(SGI_THREADS) && defined(USE_DL) - long addr, size; - static int local_initialized = 0; -#endif /* SGI_THREADS and USE_DL */ pthread_t th; int success; dprintf(("start_new_thread called\n")); if (!initialized) init_thread(); - success = pthread_create(&th, pthread_attr_default, func, arg); + success = pthread_create(&th, pthread_attr_default, + (void* (*) _P((void *)))func, arg); return success < 0 ? 0 : 1; }
