MCPcopy Create free account
hub / github.com/Tencent/phxqueue / RWLock

Method RWLock

phxqueue/comm/utils/concurrent_util.h:52–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50 };
51
52 explicit RWLock(pthread_rwlock_t *l, LockMode mode) : l_(l) {
53 if (LockMode::READ == mode) {
54 assert(0 == pthread_rwlock_rdlock(l_));
55 } else if (LockMode::WRITE == mode) {
56 assert(0 == pthread_rwlock_wrlock(l_));
57 }
58 }
59
60 virtual ~RWLock() {
61 assert(0 == pthread_rwlock_unlock(l_));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected