Boost logo

Boost Users :

From: Richard Hodges (hodges.r_at_[hidden])
Date: 2023-12-06 14:45:51


>
>
>
> One of the things that keeps cropping up in the ability to notify another
> function that something has finished. In the past, I would use
> condition_variable and wait on that.
>
> There are a couple of ways I have used to do this.
Have a look at Klemens' experimental library
https://github.com/klemens-morgenstern/sam
It contains an async condition variable fully compatible with asio

The other way is to use an asio steady_timer. You would cancel the timer in
order to signal the condition. The waiter would see this as an
*operation_aborted* error, which would indicate, "you have been signalled".
You can set the timer to expires_at(std::chrono::steady_clock::max()) to
indicate that the wait should be indefinite.

R



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net