Changeset 3431 in Sophya for trunk/SophyaPI


Ignore:
Timestamp:
Dec 11, 2007, 12:32:06 PM (18 years ago)
Author:
ansari
Message:

Ajout protection attente fin de thread, avant delete objet thread lors de sortie piapp (exitpiapp) - Reza 11/12/2007

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/pistdimgapp.cc

    r3370 r3431  
    413413  Reveil(PIStdImgApp* app) :
    414414    ZThread()
    415   { _app = app; _fgstop = false; }
     415  { _app = app; _fgstop = false; _running = false; }
    416416  virtual ~Reveil() { }
    417417  inline void Stop() { _fgstop = true; }
     418  inline bool IsRunning() { return _running; }
    418419  virtual void run()
    419420  {
     421    _running = true;
    420422    while (!_fgstop) {
    421423      usleep(2000);
     
    425427      _app->UnlockMutex(fgb);     
    426428    }
     429    _running = false;
    427430  }
    428431
    429432  PIStdImgApp* _app;
    430433  bool _fgstop;
     434  bool _running;
    431435};
    432436
     
    515519thr_glsyn.unlock();  //  <ZThread>
    516520mrv->Stop();
     521// Reza- Dec07 : On attend que le tread Reveil soit arrete avant de le supprimer
     522while (mrv->IsRunning())  usleep(2000);
    517523delete mrv;
    518524// delete mru;
Note: See TracChangeset for help on using the changeset viewer.