-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix AsyncFileDialog blocking on Windows
ThreadFuture would send a mutex to the thread it spawned, which would then immediately lock that mutex to pass it into whichever blocking callback wanted to write to the data inside it. Meanwhile, calling `poll` on that ThreadFuture would *also* lock that mutex, blocking until the spawned thread finished running and hence defeating the entire purpose of using a future, and possibly even causing the *spawned* thread to block instead if `poll` was called fast enough, causing a deadlock. This is fixed by separating the `data` and `waker` into two separate mutexes; calling `poll` always sets the `waker` but doesn't lock the mutex for `data`.
- Loading branch information
1 parent
7db7985
commit c472f94
Showing
2 changed files
with
33 additions
and
21 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
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