Make folly::coro::Mutex lock operations SemiAwaitable
Summary: Making the `co_scoped_lock()` and `co_lock()` operations semi-awatitable forces the caller to provide an executor on which to resume the awaiting coroutine in the case that the lock could not be acquire synchronously. This improves the safety of folly::coro::Mutex when used from within an InlineTask which does not implicitly wrap all co_await expressions to ensure transitions back to the executor and would otherwise implicitly resume the next lock-acquirer inline inside the call to .unlock(). Reviewed By: andriigrynenko Differential Revision: D14708636 fbshipit-source-id: bb9cda1a4a6e53978071a7b98ebf9affeef47c7d
Showing
Please register or sign in to comment