axeld + bonefish:

Before starting to wait on a condition variable check for pending
signals first, if the call is interruptable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23980 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-02-17 14:38:23 +00:00
parent 7d2d758d46
commit fe19cba8f0
1 changed files with 9 additions and 1 deletions

View File

@ -156,8 +156,16 @@ PrivateConditionVariableEntry::Wait(uint32 flags)
entry = entry->fThreadNext;
}
// all entries are unnotified -- wait
// When interruptable, check pending signals first
struct thread* thread = thread_get_current_thread();
if (((flags & B_CAN_INTERRUPT)
&& (thread->sig_pending & ~thread->sig_block_mask) != 0)
|| ((flags & B_KILL_CAN_INTERRUPT)
&& (thread->sig_pending & KILL_SIGNALS))) {
return B_INTERRUPTED;
}
// wait
thread->next_state = B_THREAD_WAITING;
thread->condition_variable_entry = firstEntry;
thread->sem.blocking = -1;