I have a class that has a `wait` function that waits for a queue to be filled up. Once the queue is non-empty, the `condition_variable` is notified, and the waiting function empties the queue and processes its elements.

I'd like to verify in a unit test that this `wrapper::wait` call (which checks if the queue is non-empty) actually blocks the thread. I have a flaky setup with an `atomic_bool` that is set after the wait call and thought naively that doing the following sequence would work.

1. Create thread with function that calls `wait`, then sets the `atomic_bool`.
2. After thread creation, verify `atomic_bool` has begin value
3. Push something into queue in the main thread, making the `atomic_bool` change value from the other thread.
4. Verify the changed value in the main thread.

There are two missing synchronization points: the two "verify"s aren't guaranteed to happen when I want them to:

* I can't verify that wait has been called in the thread.
* I can't verify the thread has had the chance to change the `atomic_bool`.

Is there any way to solve this problem without adding one or more additional `condition_variables`/`mutexes` to synchronize the operations?