This question is out of curiousity, I do not currently need this.
Is there a reentrant lock (mutex) for kotlin coroutines? If not why?
Couldn't the context / parent context act as the reentrant discriminant? (if a parent scope hold the lock a children can enter it)
Previous question (which basically explain what a reentrant lock is):
Is there something in coroutines that works as a context-aware mutex in a way similar to
synchronize
keyword?
Synchronize lock access to the thread level. This means that if you call another fun that use the synchronize on the same object without jumping threads that fun doesn't block at the synchronize keyword.
With coroutines if you use a mutex in 2 fun and one call the other it creates a deadlock.
Is there something like a mutex that allow "children" coroutines of the lock holder go into the lock?