Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 614c66b5c206498f57ee1be35c900c174b55e60e
Ticket: 990453ffffffffffffffffffffffffffffffffff
leaking mutexes on Unix
User & Date: dossy on 2004-08-25 18:44:38
Changes

  1. 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
    ().
    
    
  2. login: "dossy"
  3. mimetype: "text/plain"
  4. username: "dossy"