C
Chris Dunaway
Suppose I have several threads that need to access the same object.
ThreadA successfully acquires the lock using SyncLock. ThreadB
attempts to acquire the lock and blocks and then ThreadC attempts to
acquire the lock and blocks.
When ThreadA releases the lock, will ThreadB get it before ThreadC by
virtue of the fact that ThreadB attempted to lock the object before
ThreadC did? Is there any way to enforce this sequence? I want to
make sure that ThreadB gets the lock BEFORE ThreadC. Is this possible?
ThreadA successfully acquires the lock using SyncLock. ThreadB
attempts to acquire the lock and blocks and then ThreadC attempts to
acquire the lock and blocks.
When ThreadA releases the lock, will ThreadB get it before ThreadC by
virtue of the fact that ThreadB attempted to lock the object before
ThreadC did? Is there any way to enforce this sequence? I want to
make sure that ThreadB gets the lock BEFORE ThreadC. Is this possible?