Home Comments

Doc: return value of RecMutex::tryLock()

n2503vn2503v Member Alex MakarenkoOrganization: ACFR, University of SydneyProject: Orca ✭✭✭
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."

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


  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff

    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!

Sign In or Register to comment.