Patch #716969: Detect thread creation failure. Will backport to 2.2.

This commit is contained in:
Martin v. Löwis 2003-04-19 07:44:52 +00:00
parent 1e91d8eb03
commit 910ae6283a
2 changed files with 9 additions and 9 deletions

View file

@ -40,8 +40,6 @@ PyThread_start_new_thread(void (*func)(void *), void *arg)
{
thread_t tid;
struct func_arg *funcarg;
int success = 0; /* init not needed when SOLARIS_THREADS and */
/* C_THREADS implemented properly */
dprintf(("PyThread_start_new_thread called\n"));
if (!initialized)
@ -53,7 +51,7 @@ PyThread_start_new_thread(void (*func)(void *), void *arg)
THR_DETACHED | THR_NEW_LWP, &tid)) {
perror("thr_create");
free((void *) funcarg);
success = -1;
return -1;
}
return tid;
}