Changeset 3219 in Sophya


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

Location:
trunk/SophyaLib/SysTools
Files:
2 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);
  • trunk/SophyaLib/SysTools/zthread.h

    r3217 r3219  
    9191class ZMutex {
    9292public:
    93   explicit      ZMutex();
     93  explicit      ZMutex(bool fgd=false);
    9494  virtual       ~ZMutex();
    9595  //! Locks the mutex object
     
    118118  pthread_mutex_t *  _mutx;
    119119  pthread_cond_t *  _condv;
     120  bool _fgd;
    120121};
    121122
Note: See TracChangeset for help on using the changeset viewer.