From: Martin Willi Date: Tue, 22 Oct 2013 16:36:44 +0000 (+0200) Subject: rwlock: Re-acquire rwlock even if condvar wait times out X-Git-Tag: 5.1.1rc1~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47c76c1b053ce71cb445504f2f1e30ff095db684;p=thirdparty%2Fstrongswan.git rwlock: Re-acquire rwlock even if condvar wait times out A caller expects that the associated rwlock is held, whether the condvar gets signaled or the wait times out. --- diff --git a/src/libstrongswan/threading/rwlock.c b/src/libstrongswan/threading/rwlock.c index 1764457058..c0f8ec891a 100644 --- a/src/libstrongswan/threading/rwlock.c +++ b/src/libstrongswan/threading/rwlock.c @@ -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; }