-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix promise sync in bool_waiter; rename to callback_waiter
We were setting the promise in bool_waiter *before* we call the wrapped lambda, but that introduces a race condition because we have test code that waits on the promise and then checks a value that it expects to have been set inside the lambda. This reverses it so that the promise is set *after* the lambda is called, which should solve the intermittent failure of the 009 test caused by exactly this race condition. While here, I also refactored this to a `promise<void>` since we are never actually meaningfully using the `bool` value (which either returns true, or hangs), and then since it isn't a "bool" waiter anymore, renamed to callback_waiter. `get` doesn't seem useful (it basically is a return-or-hang), so I removed it. `wait_ready()` felt too long, so I shortened it to `wait()`. Also adds documentation of the usage of `bool_waiter`.
- Loading branch information
Showing
6 changed files
with
100 additions
and
71 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
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
Oops, something went wrong.