Overview
| Artifact ID: | 614c66b5c206498f57ee1be35c900c174b55e60e |
|---|---|
| Ticket: | 990453ffffffffffffffffffffffffffffffffff
leaking mutexes on Unix |
| User & Date: | dossy on 2004-08-25 18:44:38 |
Changes
- icomment:
Logged In: YES user_id=21885 The dangerous thing about this is that pthread_mutex_destroy () on some platforms will cause a crash if the mutex is locked. So, destroying mutexes introduces a kind of "race condition" -- the thread that wants to destroy the mutex cannot guarantee that another thread doesn't have the mutex locked without locking the mutex itself, but once it's locked the mutex, it cannot destroy it because now the mutex is locked. See AOLserver Bug #810799 for a discussion on this. Destroying a locked mutex definitely crashes Linux (not sure if it's LinuxThreads or NPTL or both) but doesn't seem to crash on Solaris, but the manpages for both indicate that a mutex should be unlocked before executing pthread_mutex_destroy ().
- login: "dossy"
- mimetype: "text/plain"
- username: "dossy"