mirror of https://github.com/python/cpython
bugfix: PyThread_start_new_thread() returns the thread ID, not a flag;
will backport.
This commit is contained in:
parent
bb4503716f
commit
82247cb7d1
|
@ -35,21 +35,18 @@ PyThread__init_thread(void)
|
|||
long
|
||||
PyThread_start_new_thread(void (*func)(void *), void *arg)
|
||||
{
|
||||
int aThread;
|
||||
int success = 0;
|
||||
int thread_id;
|
||||
|
||||
aThread = _beginthread(func,
|
||||
thread_id = _beginthread(func,
|
||||
NULL,
|
||||
OS2_STACKSIZE(_pythread_stacksize),
|
||||
arg);
|
||||
|
||||
if (aThread == -1) {
|
||||
success = -1;
|
||||
fprintf(stderr, "aThread failed == %d", aThread);
|
||||
if (thread_id == -1) {
|
||||
dprintf(("_beginthread failed. return %ld\n", errno));
|
||||
}
|
||||
|
||||
return success;
|
||||
return thread_id;
|
||||
}
|
||||
|
||||
long
|
||||
|
|
Loading…
Reference in New Issue