This is an archive of the discontinued LLVM Phabricator instance.

[Support] Generic version of RWMutex
Needs ReviewPublic

Authored by mshockwave on Oct 31 2016, 12:40 AM.

Details

Summary

This revision provides similar lock/unlock behavior to std::unique_lock in addition to std::defer_lock.
User can choose to lock the mutex upon object construction or do it manually. The lock would be unlocked either within the destructor or by calling unlock explicitly.
The original SmartScopedReader and SmartScopedWriter are also replaced by this generic version of reader/writer lock.

Diff Detail

Event Timeline

mshockwave retitled this revision from to [Support] Generic version of RWMutex.
mshockwave updated this object.
mshockwave added reviewers: resistor, chandlerc.
mshockwave added a subscriber: llvm-commits.