Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix promise sync in bool_waiter; rename to callback_waiter #48

Merged
merged 1 commit into from
Sep 22, 2023

Commits on Sep 22, 2023

  1. 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`.
    jagerman committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    6bf3109 View commit details
    Browse the repository at this point in the history