-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reset the shared state even earlier when signaling completion in asyn…
…c_rw_mutex Reset the shared state before updating the head of the queue. Once the head of the queue is updated, there's a small time window where continuations could be run inline, and resetting the shared state in `done` could release the last reference to the shared state. Since we want to ensure that the last reference is always released in a continuation, we move the resetting of the shared state to happen before calling `done`. It's safe to do because if no continuations have been added, the shared state is still kept alive by senders, and if continuations have been added, they'll also hold references to the shared state.
- Loading branch information
Showing
1 changed file
with
20 additions
and
14 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