tango.core.sync.Mutex.tryLock

Sean Kelly sean at f4.ca
Sat Jul 28 19:45:18 PDT 2007


Jason House wrote:
> tryLock does not seem to work as I expected.  I thought it returns if it 
> was successful or not.  What could possibly cause the code below to 
> fail?  I'm using linux.
> 
> myMutex.tryLock();
> assert(myMutex.tryLock() == false); // fails

Locks in Tango are recursive, so you're guaranteed to succeed if you 
already hold the lock.


Sean


More information about the Digitalmars-d-learn mailing list