This type mirrors the interface of std::shared_lock as much as possible.
Declared in <folly/coro/SharedLock.h>
template<typename Mutex>
class SharedLock
: public /* implementation-defined */
The main difference between this type and std::shared_lock is that this type is designed to be used with asynchronous shared-mutex types where the lock acquisition is an asynchronous operation.
TODO: Actually implement the .co_lock() method on this class.
Workaround for now is to use: SharedLock<SharedMutex> lock{mutex, std::defer_lock}; ... lock = co_await lock.mutex()->co_scoped_lock_shared();
| Name | Description |
|---|---|
/* implementation-defined */ |
| Name | Description |
|---|---|
operator= | Assignment operators |
mutex | |
owns_lock | |
release | |
swap | |
try_lock | |
unlock | |
operator bool | Conversion to bool |
| Name |
|---|
Unnamed using |
| Name |
|---|
locked_ |
mutex_ |
| Name | Description |
|---|---|
SharedLock<Mutex> | Deduces the mutex type of a SharedLock from its constructor arguments. |