forked from Matthias247/futures-intrusive
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wake Waker in Mutex outside of synchronous Mutex
Waking a Waker inside a synchronous Mutex can lead the next task to get scheduled very quickly and immediately getting blocked on the synchronous Mutex. In this case the thread executing this task might need to get yield and scheduled again later. In order to avoid the unnecessary scheduling operation we return the Waker and wake it outside of the synchronous Mutex. In this case the next task will have an increased chance to grab the synchronous Mutex.
- Loading branch information
1 parent
aab4c38
commit ff7eb70
Showing
1 changed file
with
46 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters