mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
bugfix: PyThread_start_new_thread() returns the thread ID, not a flag;
will backport.
This commit is contained in:
parent
bb4503716f
commit
82247cb7d1
1 changed files with 4 additions and 7 deletions
|
@ -35,21 +35,18 @@ PyThread__init_thread(void)
|
||||||
long
|
long
|
||||||
PyThread_start_new_thread(void (*func)(void *), void *arg)
|
PyThread_start_new_thread(void (*func)(void *), void *arg)
|
||||||
{
|
{
|
||||||
int aThread;
|
int thread_id;
|
||||||
int success = 0;
|
|
||||||
|
|
||||||
aThread = _beginthread(func,
|
thread_id = _beginthread(func,
|
||||||
NULL,
|
NULL,
|
||||||
OS2_STACKSIZE(_pythread_stacksize),
|
OS2_STACKSIZE(_pythread_stacksize),
|
||||||
arg);
|
arg);
|
||||||
|
|
||||||
if (aThread == -1) {
|
if (thread_id == -1) {
|
||||||
success = -1;
|
|
||||||
fprintf(stderr, "aThread failed == %d", aThread);
|
|
||||||
dprintf(("_beginthread failed. return %ld\n", errno));
|
dprintf(("_beginthread failed. return %ld\n", errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
return success;
|
return thread_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
long
|
long
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue