This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Patch to mutex.c


Title: RE: Patch to mutex.c

Further to the behavior of RECURSIVE mutexes. The man file does indicate the unpredictable nature of unlocking and non-locked mutex. I noted several exchanges on this list on the subject of man pages versus the standard. According to the standard:

"If the mutex type is PTHREAD_MUTEX_RECURSIVE, then the mutex maintains the concept of a lock count.
When a thread successfully acquires a mutex for the first time, the lock count is set to one. Every
time a thread relocks this mutex, the lock count is incremented by one. Each time the thread unlocks
the mutex, the lock count is decremented by one. When the lock count reaches zero, the mutex becomes
available for other threads to acquire. If a thread attempts to unlock a mutex that it has not locked
or a mutex which is unlocked, an error will be returned."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]