From: Samuel Just Date: Sat, 9 Nov 2013 22:31:55 +0000 (-0800) Subject: RWLock: assert pthread function return values X-Git-Tag: v0.81~57^2~49 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=816b10ed8cca13659b681fb41a2a940abc33de27;p=ceph.git RWLock: assert pthread function return values Signed-off-by: Samuel Just Reviewed-by: Greg Farnum --- diff --git a/src/common/RWLock.h b/src/common/RWLock.h index f901ac0de7d..9fe566fb44c 100644 --- a/src/common/RWLock.h +++ b/src/common/RWLock.h @@ -42,13 +42,15 @@ public: void unlock() const { if (g_lockdep) id = lockdep_will_unlock(name, id); - pthread_rwlock_unlock(&L); + int r = pthread_rwlock_unlock(&L); + assert(r == 0); } // read void get_read() const { if (g_lockdep) id = lockdep_will_lock(name, id); - pthread_rwlock_rdlock(&L); + int r = pthread_rwlock_rdlock(&L); + assert(r == 0); if (g_lockdep) id = lockdep_locked(name, id); } bool try_get_read() const { @@ -65,7 +67,8 @@ public: // write void get_write() { if (g_lockdep) id = lockdep_will_lock(name, id); - pthread_rwlock_wrlock(&L); + int r = pthread_rwlock_wrlock(&L); + assert(r == 0); if (g_lockdep) id = lockdep_locked(name, id); } bool try_get_write() {