avoid crash on stupid but allowable usage of pthread_mutex_unlock
authorRich Felker <dalias@aerifal.cx>
Wed, 30 Mar 2011 14:32:45 +0000 (10:32 -0400)
committerRich Felker <dalias@aerifal.cx>
Wed, 30 Mar 2011 14:32:45 +0000 (10:32 -0400)
commita1eb8cb5dab06dd23c256d03d82ef6b0efc4b6c6
tree460a8ef2e7cfd22d87927bb62b2a214e6eac77db
parent620a1346382f9e10b516bc168f86d499b6716769
avoid crash on stupid but allowable usage of pthread_mutex_unlock

unlocking an unlocked mutex is not UB for robust or error-checking
mutexes, so we must avoid calling __pthread_self (which might crash
due to lack of thread-register initialization) until after checking
that the mutex is locked.
src/thread/pthread_mutex_unlock.c