It is using
The sample has 2 background threads. Thread1 needs 1 second to perform its actions (just a sleep). Thread2 needs 250 milliseconds.
When running these threads without any sync, you will see that during thread1 execution, about 4 thread2 actions are performed, as expected.
So be able to sync them, so that one thread will only start doing the actions when the other thread is done (visaversa).
First I could not get the sample working. The threads kept waiting for eachother.
But I found the solution: you will have to set the KERNEL32.DLL ThreadSafe to YES.
Now, when using this, Thread1 will wait until Thread2 is finished and visaversa. This will go on indefinitely until the threads are stopped.
The sample has a checkbox to enable/disable the wait functionality to show the difference in output.