Changeset 3957 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 05/04/04 15:27:25 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MLog.cc
r3927 r3957 149 149 // 150 150 #ifdef _REENTRANT 151 fMuxGui = new TMutex; 151 fMuxGui = new TMutex; 152 fMuxStream = new TMutex; 152 153 #endif 153 154 … … 213 214 delete fPlugins; 214 215 #ifdef _REENTRANT 216 delete fMuxStream; 215 217 delete fMuxGui; 216 218 #endif … … 359 361 360 362 // lock mutex 361 Lock ("UpdateGui");363 LockUpdate("UpdateGui"); 362 364 363 365 TGText &txt=*fGui->GetText(); … … 387 389 388 390 // release mutex 389 UnLock("UpdateGui"); 391 UnLockUpdate("UpdateGui"); 392 } 393 394 void MLog::LockUpdate(const char *msg) 395 { 396 #ifdef _REENTRANT 397 if (fMuxGui->Lock()==13) 398 Error("LockUpdate", "%s - mutex is already locked by this thread\n", msg); 399 #endif 400 } 401 402 void MLog::UnLockUpdate(const char *msg) 403 { 404 #ifdef _REENTRANT 405 if (fMuxGui->UnLock()==13) 406 Error("UnLockUpdate", "%s - tried to unlock mutex locked by other thread\n", msg); 407 #endif 390 408 } 391 409 … … 393 411 { 394 412 #ifdef _REENTRANT 395 if (fMux Gui->Lock()==13)413 if (fMuxStream->Lock()==13) 396 414 Error("Lock", "%s - mutex is already locked by this thread\n", msg); 397 415 #endif … … 401 419 { 402 420 #ifdef _REENTRANT 403 if (fMux Gui->UnLock()==13)421 if (fMuxStream->UnLock()==13) 404 422 Error("UnLock", "%s - tried to unlock mutex locked by other thread\n", msg); 405 423 #endif … … 412 430 int MLog::sync() 413 431 { 414 Lock ("sync");432 LockUpdate("sync"); 415 433 WriteBuffer(); 416 UnLock ("sync");434 UnLockUpdate("sync"); 417 435 418 436 if (fDevice&eStdout) … … 448 466 if (fOutputLevel <= fDebugLevel) 449 467 { 450 Lock ("overflow");468 LockUpdate("overflow"); 451 469 452 470 *fPPtr++ = (char)i; … … 455 473 WriteBuffer(); 456 474 457 UnLock ("overflow");475 UnLockUpdate("overflow"); 458 476 } 459 477 -
trunk/MagicSoft/Mars/mbase/MLog.h
r3927 r3957 71 71 #ifdef _REENTRANT 72 72 TMutex *fMuxGui; //! Mutex locking access of TGListBox 73 TMutex *fMuxStream; //! Mutex locking access to streaming 73 74 #endif 74 75 … … 102 103 ~MLog(); 103 104 104 void Lock(const char *msg); 105 void UnLock(const char *msg); 105 void LockUpdate(const char *msg); 106 void UnLockUpdate(const char *msg); 107 108 void Lock(const char *msg=""); 109 void UnLock(const char *msg=""); 106 110 107 111 void EnableDirectGui() { fIsDirectGui = kTRUE; }
Note:
See TracChangeset
for help on using the changeset viewer.