rwlock: Re-acquire rwlock even if condvar wait times out
authorMartin Willi <martin@revosec.ch>
Tue, 22 Oct 2013 16:36:44 +0000 (18:36 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 23 Oct 2013 09:52:26 +0000 (11:52 +0200)
A caller expects that the associated rwlock is held, whether the condvar
gets signaled or the wait times out.

src/libstrongswan/threading/rwlock.c

index 1764457..c0f8ec8 100644 (file)
@@ -417,7 +417,7 @@ METHOD(rwlock_condvar_t, timed_wait_abs, bool,
        thread_cleanup_push((thread_cleanup_t)this->mutex->unlock, this->mutex);
        timed_out = this->condvar->timed_wait_abs(this->condvar, this->mutex, time);
        thread_cleanup_pop(TRUE);
-       thread_cleanup_pop(!timed_out);
+       thread_cleanup_pop(TRUE);
        return timed_out;
 }