diff options
author | Trent Mick <trentm@activestate.com> | 2000-08-23 21:33:05 (GMT) |
---|---|---|
committer | Trent Mick <trentm@activestate.com> | 2000-08-23 21:33:05 (GMT) |
commit | 635f6fb0e9fade3c734d650951815682b08bbec2 (patch) | |
tree | e8e8cc921869651ba638995d534203797508f5e5 /Python/thread_pthread.h | |
parent | b745a0481b8caff2b3ca9e90e48289f2f65f7b4f (diff) | |
download | cpython-635f6fb0e9fade3c734d650951815682b08bbec2.zip cpython-635f6fb0e9fade3c734d650951815682b08bbec2.tar.gz cpython-635f6fb0e9fade3c734d650951815682b08bbec2.tar.bz2 |
This patch partly (some stuff went in already) ports Python to Monterey.
- Fix bug in thread_pthread.h::PyThread_get_thread_ident() where
sizeof(pthread) < sizeof(long).
- Add 'configure' for:
- SIZEOF_PTHREAD is pthread_t can be included via <pthread.h>
- setting Monterey system name
- appropriate CC,LINKCC,LDSHARED,OPT, and CCSHARED for Monterey
- Add section in README for Monterey build
Diffstat (limited to 'Python/thread_pthread.h')
-rw-r--r-- | Python/thread_pthread.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index 2ef46c0..2d6a4f8 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -171,6 +171,13 @@ PyThread_start_new_thread(void (*func)(void *), void *arg) return success != 0 ? 0 : 1; } +/* XXX This implementation is considered (to quote Tim Peters) "inherently + hosed" because: + - It does not guanrantee the promise that a non-zero integer is returned. + - The cast to long is inherently unsafe. + - It is not clear that the 'volatile' (for AIX?) and ugly casting in the + latter return statement (for Alpha OSF/1) are any longer necessary. +*/ long PyThread_get_thread_ident(void) { @@ -179,7 +186,11 @@ PyThread_get_thread_ident(void) PyThread_init_thread(); /* Jump through some hoops for Alpha OSF/1 */ threadid = pthread_self(); +#if SIZEOF_PTHREAD_T <= SIZEOF_LONG + return (long) threadid; +#else return (long) *(long *) &threadid; +#endif } static void |