* _user_unblock_thread[s]() also set the user thread's wait_status, now. This
makes them more convenient to use, since the caller doesn't need to know the target threads' user thread structure. * Adjusted the pthread rwlock implementation accordingly. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29578 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
9e83cc1768
commit
4c35c6b5e1
@ -2286,7 +2286,10 @@ user_unblock_thread(thread_id threadID, status_t status)
|
||||
if (thread->user_thread == NULL)
|
||||
return B_NOT_ALLOWED;
|
||||
|
||||
thread_unblock_locked(thread, status);
|
||||
if (thread->user_thread->wait_status > 0) {
|
||||
thread->user_thread->wait_status = status;
|
||||
thread_unblock_locked(thread, status);
|
||||
}
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
@ -225,10 +225,8 @@ private:
|
||||
waiters.Remove(waiter);
|
||||
owner = waiter->thread;
|
||||
|
||||
if (waiter->userThread->wait_status > 0) {
|
||||
waiter->userThread->wait_status = B_OK;
|
||||
if (waiter->userThread->wait_status > 0)
|
||||
_kern_unblock_thread(waiter->thread, B_OK);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -248,7 +246,6 @@ private:
|
||||
waiters.Remove(waiter);
|
||||
|
||||
if (waiter->userThread->wait_status > 0) {
|
||||
waiter->userThread->wait_status = B_OK;
|
||||
readers[readerCount++] = waiter->thread;
|
||||
reader_count++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user