Doc: return value of RecMutex::tryLock()

n2503vn2503v Alex MakarenkoOrganization: ACFR, University of SydneyProject: OrcaMember ✭✭✭
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

  • benoitbenoit Rennes, FranceBenoit FoucherOrganization: ZeroC, Inc.Project: IceAdministrators, ZeroC Staff ZeroC Staff
    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.
Sign In or Register to comment.