Archived

This forum has been archived. Please start a new discussion on GitHub.

Doc: return value of RecMutex::tryLock()

What does RecMutex::tryLock() return when the mutex is already locked by the same thread? I assume it's FALSE but the manual seems to say something different.

Manual sec. 29.5
"The tryLock function works like lock, but, instead of blocking the caller, it returns false if the mutex is locked by another thread. Otherwise, the return value is true."

RecMutex.h
"Returns true if the lock was acquired, and false otherwise."

Comments

  • benoit
    benoit Rennes, France
    Hi,

    The manual is correct, if the mutex is already locked by the calling thread tryLock() returns true. The comment in the header file is a bit misleading, it will be fixed!

    Cheers,
    Benoit.