Changeset 3219 in Sophya for trunk/SophyaLib/SysTools/zthread.cc


Ignore:
Timestamp:
Apr 12, 2007, 5:15:41 PM (18 years ago)
Author:
ansari
Message:

Ajout flag pour destroy_mutex selectif par le destructeur de ZMutex (pb erreur lors de sortie de piapp), Reza 12/04/2007

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/SysTools/zthread.cc

    r3217 r3219  
    213213  Constructor: Creates a associated pair of POSIX \c pthread_mutex_t
    214214  and \c pthread_cond_t objects
    215 */
    216 ZMutex::ZMutex()
     215  \param : if fgd == true , the destructor call pthread_mutex_destroy/pthread_cond_destroy
     216*/
     217ZMutex::ZMutex(bool fgd)
    217218{
    218219  _mutx = new pthread_mutex_t;
     
    223224  rc = pthread_cond_init(_condv, NULL);
    224225  CheckSt(rc,"ZMutex::ZMutex() Pb pthread_cond_init");
     226  _fgd = fgd;
    225227}
    226228
    227229ZMutex::~ZMutex()
    228230{
     231  if (_fgd == false) return;
    229232  int rc;
    230233  rc = pthread_mutex_destroy(_mutx);
Note: See TracChangeset for help on using the changeset viewer.