00001 //------------------------------------------------------------- 00002 // Go4 Release Package v3.04-01 (build 30401) 00003 // 28-November-2008 00004 //--------------------------------------------------------------- 00005 // The GSI Online Offline Object Oriented (Go4) Project 00006 // Experiment Data Processing at EE department, GSI 00007 //--------------------------------------------------------------- 00008 // 00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI 00010 // Planckstr. 1, 64291 Darmstadt, Germany 00011 //Contact: http://go4.gsi.de 00012 //---------------------------------------------------------------- 00013 //This software can be used under the license agreements as stated 00014 //in Go4License.txt file which is part of the distribution. 00015 //---------------------------------------------------------------- 00016 #include "TGo4CintLockTimer.h" 00017 00018 #include "Riostream.h" 00019 00020 #include "TThread.h" 00021 #include "TApplication.h" 00022 00023 #include "TGo4Log.h" 00024 #include "TGo4AnalysisClient.h" 00025 00026 UInt_t TGo4CintLockTimer::fguTHREADTIME = 50;//50 00027 00028 TGo4CintLockTimer::TGo4CintLockTimer (TGo4AnalysisClient* parent,Long_t msperiod, Bool_t mode) 00029 :TTimer(msperiod,mode),fbHaveLock(kFALSE),fxParent(parent) 00030 { 00031 } 00032 00033 TGo4CintLockTimer::~TGo4CintLockTimer() 00034 { 00035 if(fbHaveLock) fxParent->UnLockAll(); 00036 } 00037 00038 Bool_t TGo4CintLockTimer::Notify() 00039 { 00040 //TurnOff(); 00041 if(fbHaveLock) 00042 { 00043 //if(TThread::Exists()) TGo4LockGuard::UnLockMainMutex(); 00044 fxParent->UnLockAll(); 00045 //cout <<"U TGo4CintLockTimer unlocked" << endl; 00046 fbHaveLock=kFALSE; 00047 } 00048 00049 gSystem->Sleep(fguTHREADTIME); 00050 if(!fbHaveLock) 00051 { 00052 //if(TThread::Exists()) TGo4LockGuard::LockMainMutex(); 00053 fxParent->LockAll(); 00054 //cout <<"L TGo4CintLockTimer has lock" << endl; 00055 fbHaveLock=kTRUE; 00056 } 00057 Reset(); 00058 //TurnOn(); 00059 return kFALSE; 00060 } 00061 00062 00063 00064 00065 00066 00067 //----------------------------END OF GO4 SOURCE FILE ---------------------