projects
/
c11tester.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use simple_action_list for conditionvariable waiters
[c11tester.git]
/
threads.cc
diff --git
a/threads.cc
b/threads.cc
index a2d2ed166ba3350400e6e5c13cb9b897fdad628a..a576697f561087fe2c09c607e44ef02bb0c6fa8c 100644
(file)
--- a/
threads.cc
+++ b/
threads.cc
@@
-496,6
+496,14
@@
Thread * Thread::waiting_on() const
bool Thread::is_waiting_on(const Thread *t) const
{
Thread *wait;
bool Thread::is_waiting_on(const Thread *t) const
{
Thread *wait;
+
+ // One thread relocks a recursive mutex
+ if (waiting_on() == t && pending->is_lock()) {
+ int mutex_type = pending->get_mutex()->get_state()->type;
+ if (mutex_type == PTHREAD_MUTEX_RECURSIVE)
+ return false;
+ }
+
for (wait = waiting_on();wait != NULL;wait = wait->waiting_on())
if (wait == t)
return true;
for (wait = waiting_on();wait != NULL;wait = wait->waiting_on())
if (wait == t)
return true;