Mercurial > cpython-lru_cache-weakref
diff Python/thread_pthread.h @ 10400:94ad90fd2712 legacy-trunk
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?]
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 15 Mar 1999 20:27:53 +0000 |
| parents | 877d23bd5bdc |
| children | ff243b0f16ee |
line wrap: on
line diff
--- a/Python/thread_pthread.h Mon Mar 15 16:37:54 1999 +0000 +++ b/Python/thread_pthread.h Mon Mar 15 20:27:53 1999 +0000 @@ -178,14 +178,14 @@ #endif ); - if (success >= 0) { + if (success == 0) { #if defined(PY_PTHREAD_D4) || defined(PY_PTHREAD_D6) || defined(PY_PTHREAD_D7) pthread_detach(&th); #elif defined(PY_PTHREAD_STD) pthread_detach(th); #endif } - return success < 0 ? 0 : 1; + return success != 0 ? 0 : 1; } long PyThread_get_thread_ident _P0()
