X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=threads.cc;h=a576697f561087fe2c09c607e44ef02bb0c6fa8c;hb=f269c2a1c390e82ae189bc690a750601f874283f;hp=a2d2ed166ba3350400e6e5c13cb9b897fdad628a;hpb=f4c344cc8e76cd1b8271329f8827be2b4c503a6a;p=c11tester.git diff --git a/threads.cc b/threads.cc index a2d2ed16..a576697f 100644 --- 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; + + // 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;