2 // Author: Matevz Tadel 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
10 #include "AliDimIntNotifier.h"
14 //______________________________________________________________________________
15 // Full description of AliDimIntNotifier
18 ClassImp(AliDimIntNotifier)
20 Long_t AliDimIntNotifier::fgMainThreadId = 0;
22 void AliDimIntNotifier::SetMainThreadId()
24 fgMainThreadId = TThread::SelfId();
27 AliDimIntNotifier::AliDimIntNotifier(const TString& service) :
28 DimUpdatedInfo(service, -1),
33 fReThreader.Connect("Timeout()", "AliDimIntNotifier", this, "DimMessage()");
36 void AliDimIntNotifier::StartTimer()
40 pthread_kill((pthread_t)fgMainThreadId, SIGALRM);
43 void AliDimIntNotifier::StopTimer()
45 fReThreader.TurnOff();
48 void AliDimIntNotifier::infoHandler()
53 fLastMessage = getData() ? getInt() : -1;
54 if (TThread::SelfId() != fgMainThreadId)
60 ::Warning("DIMinfoHandler", "DIM message received from CINT thread.");
66 void AliDimIntNotifier::infoHandlerTest(Int_t fake)
68 // Fake handler for testing.
72 if (TThread::SelfId() != fgMainThreadId)
78 Warning("infoHandlerTest", "Was called from CINT thread ...");
84 void AliDimIntNotifier::DimMessage(Int_t)
87 if (fLastMessage != -1)
89 Emit("DimMessage(Int_t)", fLastMessage);