summaryrefslogtreecommitdiffstats
path: root/Python/thread_pthread.h
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-06-11 18:32:18 (GMT)
committerGuido van Rossum <guido@python.org>1996-06-11 18:32:18 (GMT)
commit6602099e7c8eca0f3051d1e5bd92e634dd83ffd4 (patch)
treed75040efbf61c8f3c3e36f77566cb85c74b0d9c3 /Python/thread_pthread.h
parent3c0b79ca0f0b162f5bf1c38ddee9d5672fb2d009 (diff)
downloadcpython-6602099e7c8eca0f3051d1e5bd92e634dd83ffd4.zip
cpython-6602099e7c8eca0f3051d1e5bd92e634dd83ffd4.tar.gz
cpython-6602099e7c8eca0f3051d1e5bd92e634dd83ffd4.tar.bz2
Got rid of florida hack and made it work with Solaris 2.5 pthreads.
Wonder if this will break it on all other platforms :-)
Diffstat (limited to 'Python/thread_pthread.h')
-rw-r--r--Python/thread_pthread.h26
1 files changed, 7 insertions, 19 deletions
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index a4222cf..9058bf7 100644
--- a/Python/thread_pthread.h
+++ b/Python/thread_pthread.h
@@ -22,23 +22,14 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
-#ifdef sun
-#define FLORIDA_HACKS
-#endif
-
-#ifdef FLORIDA_HACKS
-/* Hacks for Florida State Posix threads implementation */
-#undef _POSIX_THREADS
-#include "/ufs/guido/src/python/Contrib/pthreads/src/pthread.h"
+/* Posix threads interface */
+
+#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 @@ static void _init_thread _P0()
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;
}