mirror of
https://github.com/python/cpython.git
synced 2025-09-01 06:28:36 +00:00
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
This commit is contained in:
parent
b745a0481b
commit
635f6fb0e9
6 changed files with 466 additions and 318 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue