mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Add the missing {} that caused the function to return ESRCH if it
had to wait for the thread to exit and if the caller didn't want the thread exit status.
This commit is contained in:
parent
e2c597dd6a
commit
ff09ba5fbb
3 changed files with 6 additions and 3 deletions
|
|
@ -77,11 +77,12 @@ pthread_join(pthread_t pthread, void **thread_return)
|
|||
_thread_kern_sched_state(PS_JOIN, __FILE__, __LINE__);
|
||||
|
||||
/* Check if the thread is not detached: */
|
||||
if ((pthread->attr.flags & PTHREAD_DETACHED) == 0)
|
||||
if ((pthread->attr.flags & PTHREAD_DETACHED) == 0) {
|
||||
/* Check if the return value is required: */
|
||||
if (thread_return)
|
||||
/* Return the thread's return value: */
|
||||
*thread_return = pthread->ret;
|
||||
}
|
||||
else
|
||||
/* Return an error: */
|
||||
ret = ESRCH;
|
||||
|
|
|
|||
|
|
@ -77,11 +77,12 @@ pthread_join(pthread_t pthread, void **thread_return)
|
|||
_thread_kern_sched_state(PS_JOIN, __FILE__, __LINE__);
|
||||
|
||||
/* Check if the thread is not detached: */
|
||||
if ((pthread->attr.flags & PTHREAD_DETACHED) == 0)
|
||||
if ((pthread->attr.flags & PTHREAD_DETACHED) == 0) {
|
||||
/* Check if the return value is required: */
|
||||
if (thread_return)
|
||||
/* Return the thread's return value: */
|
||||
*thread_return = pthread->ret;
|
||||
}
|
||||
else
|
||||
/* Return an error: */
|
||||
ret = ESRCH;
|
||||
|
|
|
|||
|
|
@ -77,11 +77,12 @@ pthread_join(pthread_t pthread, void **thread_return)
|
|||
_thread_kern_sched_state(PS_JOIN, __FILE__, __LINE__);
|
||||
|
||||
/* Check if the thread is not detached: */
|
||||
if ((pthread->attr.flags & PTHREAD_DETACHED) == 0)
|
||||
if ((pthread->attr.flags & PTHREAD_DETACHED) == 0) {
|
||||
/* Check if the return value is required: */
|
||||
if (thread_return)
|
||||
/* Return the thread's return value: */
|
||||
*thread_return = pthread->ret;
|
||||
}
|
||||
else
|
||||
/* Return an error: */
|
||||
ret = ESRCH;
|
||||
|
|
|
|||
Loading…
Reference in a new issue