From 23b95b112db936067bdf4188974680b562099587 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 22 Feb 2008 14:51:11 +0000 Subject: [PATCH] We have to remove the thread's condition variable entries when interrupted early, i.e. when signals were already pending when we started waiting. Fixes #1832. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24063 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/condition_variable.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/system/kernel/condition_variable.cpp b/src/system/kernel/condition_variable.cpp index a2c1bc898b..0bab6af682 100644 --- a/src/system/kernel/condition_variable.cpp +++ b/src/system/kernel/condition_variable.cpp @@ -162,6 +162,12 @@ PrivateConditionVariableEntry::Wait(uint32 flags) && (thread->sig_pending & ~thread->sig_block_mask) != 0) || ((flags & B_KILL_CAN_INTERRUPT) && (thread->sig_pending & KILL_SIGNALS))) { + // remove all of the thread's entries from their variables + entry = firstEntry; + while (entry) { + entry->_Remove(); + entry = entry->fThreadNext; + } return B_INTERRUPTED; }