IncThread is waiting for the mutex.
IncThread acquires the mutex.
DecThread is waiting for the mutex.
In IncThread, MyCounter.count is 1
In IncThread, MyCounter.count is 2
In IncThread, MyCounter.count is 3
In IncThread, MyCounter.count is 4
In IncThread, MyCounter.count is 5
In IncThread, MyCounter.count is 6
In IncThread, MyCounter.count is 7
In IncThread, MyCounter.count is 8
In IncThread, MyCounter.count is 9
In IncThread, MyCounter.count is 10
IncThread releases the mutex.
DecThread acquires the mutex.
In DecThread, MyCounter.count is 9
In DecThread, MyCounter.count is 8
In DecThread, MyCounter.count is 7
In DecThread, MyCounter.count is 6
In DecThread, MyCounter.count is 5
In DecThread, MyCounter.count is 4
In DecThread, MyCounter.count is 3
In DecThread, MyCounter.count is 2
In DecThread, MyCounter.count is 1
In DecThread, MyCounter.count is 0
DecThread releases the mutex. |