]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliRawReaderDateOnline.cxx
Coverity 19423
[u/mrichter/AliRoot.git] / RAW / AliRawReaderDateOnline.cxx
index 71d42bb9e2261b48add75ef33d5bfe81ec9a4f0e..c0eaf534f0eef59a0a6a76aad668765d460af1c4 100644 (file)
 
 ClassImp(AliRawReaderDateOnline)
 
+Bool_t AliRawReaderDateOnline::fgNoSleep = kTRUE;
+
 AliRawReaderDateOnline::AliRawReaderDateOnline(
 #ifdef ALI_DATE
-                                  const char* filename
+                                    const char* filename
 #else
-                                  const char* /* filename */
+                                    const char* /* filename */
 #endif
-                                  ) :
+                                  , const Char_t** customTable) :
   AliRawReaderDate((void*)NULL),
+  fTable(customTable),
   fStop(kFALSE)
 {
 
@@ -77,11 +80,21 @@ AliRawReaderDateOnline::AliRawReaderDateOnline(
   monitorSetNowait();
   monitorSetNoWaitNetworkTimeout(1000);
 
-  const Char_t* table[]  = {"ALL", "few", "*", "*",
-                            "EOR", "yes","*", "*",
-                            NULL, NULL, NULL, NULL};
-  monitorDeclareTableExtended(const_cast<char**>(table));
-
+  if (!fTable) {
+    const Char_t* table[]  = {"ALL", "few", "*", "*",
+                             "EOR", "yes","*", "*",
+                             NULL, NULL, NULL, NULL};
+    monitorDeclareTableExtended(const_cast<char**>(table));
+  }
+  else {
+    AliInfo("Custom monitoring table:");
+    Int_t index = 0;
+    while (fTable[index] != NULL) {
+      AliInfo(Form("%s %s %s %s",fTable[index],fTable[index+1],fTable[index+2],fTable[index+3]));
+      index += 4;
+    }
+    monitorDeclareTableExtended(const_cast<char**>(fTable));
+  }
   // install SIGUSR1 handler to allow clean end-of-events loop
   gSystem->AddSignalHandler(new AliRawReaderDateIntHandler(this));
 
@@ -131,6 +144,7 @@ Bool_t AliRawReaderDateOnline::NextEvent()
     
     /* retry if got no event */
     if (fEvent==NULL) {
+      if (fgNoSleep) gSystem->ProcessEvents();
       continue;
     }
     
@@ -147,6 +161,7 @@ Bool_t AliRawReaderDateOnline::NextEvent()
     if (!IsEventSelected()) {
       free(fEvent);
       fEvent = NULL;
+      if (fgNoSleep) gSystem->ProcessEvents();
       continue;
     }