mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-25 16:13:17 +00:00
Write new thread pointer back only when success.
Reviewed by: deischen
This commit is contained in:
parent
a56b526b51
commit
52d9c77df4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=116974
@ -294,9 +294,10 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr,
|
||||
ret = _thr_schedule_add(curthread, new_thread);
|
||||
if (ret != 0)
|
||||
free_thread(curthread, new_thread);
|
||||
|
||||
/* Return a pointer to the thread structure: */
|
||||
(*thread) = new_thread;
|
||||
else {
|
||||
/* Return a pointer to the thread structure: */
|
||||
(*thread) = new_thread;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -294,9 +294,10 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr,
|
||||
ret = _thr_schedule_add(curthread, new_thread);
|
||||
if (ret != 0)
|
||||
free_thread(curthread, new_thread);
|
||||
|
||||
/* Return a pointer to the thread structure: */
|
||||
(*thread) = new_thread;
|
||||
else {
|
||||
/* Return a pointer to the thread structure: */
|
||||
(*thread) = new_thread;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user