Merge pull request #2937 from simon3z/master

common: do not unlock rwlock on destruction

Reviewed-by: Samuel Just <sjust@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Samuel Just 2014-12-01 09:07:38 -08:00
commit 77deeaa4ff

View File

@ -46,7 +46,9 @@ public:
return (nwlock.read() > 0);
}
virtual ~RWLock() {
pthread_rwlock_unlock(&L);
// The following check is racy but we are about to destroy
// the object and we assume that there are no other users.
assert(!is_locked());
pthread_rwlock_destroy(&L);
}