mirror of
https://github.com/python/cpython.git
synced 2025-11-17 09:30:10 +00:00
Rob Riggs wrote:
""" Spec says that on success pthread_create returns 0. It does not say that an error code will be < 0. Linux glibc2 pthread_create() returns ENOMEM (12) when one exceed process limits. (It looks like it should return EAGAIN, but that's another story.) For reference, see: http://www.opengroup.org/onlinepubs/7908799/xsh/pthread_create.html """ [I have a feeling that similar bugs were fixed before; perhaps someone could check that all error checks no check for != 0?]
This commit is contained in:
parent
c7e7c60756
commit
701f25ef9d
1 changed files with 2 additions and 2 deletions
|
|
@ -178,14 +178,14 @@ int PyThread_start_new_thread _P2(func, void (*func) _P((void *)), arg, void *ar
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
if (success >= 0) {
|
if (success == 0) {
|
||||||
#if defined(PY_PTHREAD_D4) || defined(PY_PTHREAD_D6) || defined(PY_PTHREAD_D7)
|
#if defined(PY_PTHREAD_D4) || defined(PY_PTHREAD_D6) || defined(PY_PTHREAD_D7)
|
||||||
pthread_detach(&th);
|
pthread_detach(&th);
|
||||||
#elif defined(PY_PTHREAD_STD)
|
#elif defined(PY_PTHREAD_STD)
|
||||||
pthread_detach(th);
|
pthread_detach(th);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return success < 0 ? 0 : 1;
|
return success != 0 ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
long PyThread_get_thread_ident _P0()
|
long PyThread_get_thread_ident _P0()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue