diff options
author | Guido van Rossum <guido@python.org> | 1999-03-15 20:27:53 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-03-15 20:27:53 (GMT) |
commit | 701f25ef9dd2b97da2260dabab778ed4ab011047 (patch) | |
tree | 7f9f38c522c63610742b99bff973cd634073961b /Python | |
parent | c7e7c60756af6bbfbea74388a397e040bd81c1cc (diff) | |
download | cpython-701f25ef9dd2b97da2260dabab778ed4ab011047.zip cpython-701f25ef9dd2b97da2260dabab778ed4ab011047.tar.gz cpython-701f25ef9dd2b97da2260dabab778ed4ab011047.tar.bz2 |
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?]
Diffstat (limited to 'Python')
-rw-r--r-- | Python/thread_pthread.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index 0b4041a..fd03e91 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -178,14 +178,14 @@ int PyThread_start_new_thread _P2(func, void (*func) _P((void *)), arg, void *ar #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() |