You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ConditionVariable class provides a mechanism to safely wait for or signal state changes. A common scenario when writing multi threaded code is to protect shared resources with a mutex and then release that mutex to wait for a change of that data. If this is not carefully done this can lead to race condition in the code. A condition variable provides a safe solution to this problem by handling the wait for a state change along with releasing and acquiring the mutex automatically during this waiting period.
4
+
5
+
### ConditionVariable class reference
6
+
7
+
Coming soon
8
+
9
+
### ConditionVariable example
10
+
11
+
Below is an example of ConditionVariable usage, where one thread is generating events every 1s, and the second thread is waiting for the events and executing some action.
0 commit comments