Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7e059502f824054a1d067d6a5b944294479670e0
Ticket: 992108ffffffffffffffffffffffffffffffffff
TclFinalizeLock on Unix not correct.
User & Date: vasiljevic on 2004-07-17 04:57:37
Changes

  1. icomment:
    Logged In: YES 
    user_id=95086
    
    Frankly speaking, the common sense tells that  
    if you first destroy the thing, then you need to  
    create the thing before you can use it again. 
      
    So, if you destroy the static mutex (which you 
    did not create at the first place, rather the 
    compiler did that for you) who is going to  
    create it? 
     
    This is very implementation specific. For example, 
    have a look on the NPTL pthread_mutex_destroy: 
     
    int 
    __pthread_mutex_destroy (mutex) 
         pthread_mutex_t *mutex; 
    { 
      if (mutex->__data.__nusers != 0) 
        return EBUSY; 
     
      return 0; 
    } 
     
    I am all with you that we should aim at cleaning 
    up what's possible after us, but I'm afraid that 
    in some circumstances we might clean-up too much. 
     
    To be on the safe side, I'd rather risk a leak 
    then a (eventual) memory corruption. 
    Ideally, one would grab sources of all thread 
    library implementations, look what is really 
    done under the hood and make a wrapper with 
    ifdef's for all supported variants.  
    This is hard job to do. And implementor docs 
    are more than confusing in that respect, as 
    Andreas have found out. 
     
    
    
  2. login: "vasiljevic"
  3. mimetype: "text/plain"
  4. username: "vasiljevic"