Changeset 2491 in Sophya for trunk/SophyaPI/PIext/pistdimgapp.cc
- Timestamp:
- Jan 4, 2004, 8:02:44 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/pistdimgapp.cc
r2490 r2491 383 383 } 384 384 385 /* 385 386 class RunAlarm : public Periodic { 386 387 public: … … 393 394 PIStdImgApp* _app; 394 395 }; 395 396 */ 397 398 class Reveil : public ZThread { 399 public: 400 Reveil(PIStdImgApp* app) : 401 ZThread() 402 { _app = app; _fgstop = false; } 403 virtual ~Reveil() { } 404 inline void Stop() { _fgstop = true; } 405 virtual void run() 406 { 407 while (!_fgstop) { 408 usleep(1000); 409 _app->getMutex().broadcast(); 410 } 411 } 412 413 PIStdImgApp* _app; 414 bool _fgstop; 415 }; 396 416 /* --Methode-- */ 397 417 void PIStdImgApp::Run() … … 409 429 // Creation et demarrage de l'objet de reveil periodique 410 430 // de la boucle d'evts 411 RunAlarm * mru = new RunAlarm(this); 412 //mru->Start(); 431 /* RunAlarm * mru = new RunAlarm(this); 432 mru->Start(); */ 433 Reveil* mrv = new Reveil(this); 434 mrv->start(); 413 435 // Demarrage du thread de l'interpreteur 414 436 CmdInterpreter()->start(); … … 420 442 421 443 444 thr_glsyn.lock(); // <ZThread> 445 //DBG int klp = 0; 422 446 while (mStop) { 423 thr_glsyn.lock(); // <ZThread>424 447 fg_glsynlock = true; 448 int nevtproc = 0; 425 449 while (XtAppPending(*appctx) != 0) { 426 450 XtAppNextEvent(*appctx, &evt); 427 451 XtDispatchEvent(&evt); 452 nevtproc++; 453 if (nevtproc >= 50) break; 428 454 } 429 455 fg_glsynlock = false; 430 thr_glsyn.unlock(); // <ZThread> 431 // thr_glsyn.wait(); 432 usleep(1000); 433 } 434 435 delete mru; 456 thr_glsyn.wait(); // <ZThread> 457 // cout << "DBG-Run:: Out of wait " << ++klp << endl; 458 // usleep(1000); 459 } 460 461 thr_glsyn.unlock(); // <ZThread> 462 mrv->Stop(); 463 delete mrv; 464 // delete mru; 436 465 return; 437 466 } … … 599 628 600 629 /* --Methode-- */ 601 int PIStdImgApp::DispImage(P2DArrayAdapter* nouv, string const & name, string const& sop, int oid) 630 int PIStdImgApp::DispImage(P2DArrayAdapter* nouv, string const & name, string const& sop, 631 int oid, bool fglock) 602 632 { 603 633 PIImage* pii; … … 626 656 627 657 // <ZThread> global PIApplication event loop synchronisation 628 ZSync zs(thr_glsyn, 2);658 if (fglock) ZSync zs(thr_glsyn, 2); 629 659 630 660 // Choix de la taille de fenetre … … 682 712 /* --Methode-- */ 683 713 int PIStdImgApp::DispScDrawer(PIDrawer* scd, string const & name, string const& sop, 684 string title, int oid )714 string title, int oid, bool fglock) 685 715 { 686 716 if (scd == NULL) … … 696 726 697 727 // <ZThread> global PIApplication event loop synchronisation 698 ZSync zs(thr_glsyn, 2);728 if (fglock) ZSync zs(thr_glsyn, 2); 699 729 700 730 // Trace en superpoistion … … 785 815 /* --Methode-- */ 786 816 int PIStdImgApp::Disp3DDrawer(PIDrawer3D* dr3, string const & name, string const& sop, 787 string title, int oid )817 string title, int oid, bool fglock) 788 818 { 789 819 if (dr3 == NULL) … … 800 830 801 831 // <ZThread> global PIApplication event loop synchronisation 802 ZSync zs(thr_glsyn, 2);832 if (fglock) ZSync zs(thr_glsyn, 2); 803 833 804 834 // Trace en superpoistion
Note:
See TracChangeset
for help on using the changeset viewer.