Lock tokio::sync::Mutex
from synchronous code
#4109
Labels
A-tokio
Area: The main tokio crate
C-feature-request
Category: A feature request.
E-easy
Call for participation: Experience needed to fix: Easy / not much
E-help-wanted
Call for participation: Help is requested to fix this issue.
M-sync
Module: tokio/sync
Is your feature request related to a problem? Please describe.
I need to use async
Mutex
(because I need to lock between async yield points), but at the same time I need to share (and lock) it from some synchronous code.Describe the solution you'd like
lock_blocking
method onMutex
(and corresponding onRwLock
) that allow locking the mutex from synchronous code.Describe alternatives you've considered
Maybe there's a library that can do it already? I'm having trouble finding it though.
The text was updated successfully, but these errors were encountered: