C++ Class: EventWaitHandle

Source

GitHub: AlexanderSinko/EventWaitHandle

About

This class allows threads to communicate with each other by signaling.

An instance can hold a thread for a given number of milliseconds or even indefinitely. The thread will continue after timeout reached or waiting is aborted. An abort is triggered by calling the method Abort() or by system sending an interrupted (e.g. SIGTERM).

Remark: Not tested in Windows environment.

Usage

Create an instance of the class for each position the thread should be holden or decelerated. Insert at the position a Wait(…) with a given timeout (or constant INDEFINITELY). Insert an Abort() at every position the waiting thread should be told to continue. Beware, if no Wait is ongoing, the signal will disappear. Therefore, a call of Abort() beforehand a Wait(INDEFINITELY) may occur a deadlock!

[…]

More on GitHub: AlexanderSinko/EventWaitHandle

License

MIT

Nach oben scrollen