How to interrupt boost::this_thread in c++ -


in application have given sleep of 10 sec. have given sleep using boost::this_thread::sleep function. there possible way interrupt boost::this_thread::sleep function.?

from sleep() reference:

throws: boost::thread_interrupted if current thread of execution interrupted.

notes: sleep() 1 of predefined interruption points.

so need in thread put sleep() call in try-catch, , catch boost::thread_interrupted. call interrupt() on thread object interrupt sleep.


by way, sleep reference:

warning

deprecated since 3.0.0.

use sleep_for() , sleep_until() instead.


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -