Reputation: 591
I can wrap the desired function within another and manage e.g. that it would start when a condition fulfilled, but an 'endless loop' should not be organized around it. As far as I know pthread
supports suspend/resume by condition variables combined with muteces: wait/signal.
Upvotes: 0
Views: 434
Reputation: 62694
std::thread
will just run it's Callable argument to completion, and the only interaction available is to join
or detatch
. The closest that you can get to what you want is to interrogate the native_handle
and do platform dependant things to that.
Upvotes: 1