Check if busy before creating thread
authorslindal <slindal@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 5 Nov 2010 14:03:47 +0000 (14:03 +0000)
committerslindal <slindal@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 5 Nov 2010 14:03:47 +0000 (14:03 +0000)
EVE/EveHLT/AliEveEventBuffer.cxx
EVE/EveHLT/AliEveEventBufferHomer.cxx

index e7817e4..c94ec7e 100644 (file)
@@ -61,24 +61,24 @@ AliEveEventBuffer::~AliEveEventBuffer() {
   fCurrentEvent = NULL;
 
 }
+
 ///___________________________________________________________________________
 void AliEveEventBuffer::CreateBufferThread() {
-  cout << "CreateBufferThread()"<<endl;
-  TThread * fThread = new TThread(AliEveEventBuffer::BufferThread, (void*) this);
-  fThread->Run();
-  cout << "Done BufferThread"<<endl;
+  if(GetBusy()) {
+    cout << "Buffer is busy"<< endl;
+  } else {
+    cout << "CreateBufferThread()"<<endl;
+    TThread * fThread = new TThread(AliEveEventBuffer::BufferThread, (void*) this);
+    fThread->Run();
+    cout << "Done BufferThread"<<endl;
+  } 
 }
 
 ///___________________________________________________________________________
 void * AliEveEventBuffer::BufferThread(void * buffer) {
   cout <<"BufferThread : " <<endl;
   if(buffer) {
-    if (!reinterpret_cast<AliEveEventBuffer*>(buffer)->GetBusy()) {
       reinterpret_cast<AliEveEventBuffer*>(buffer)->MonitorBuffer();
-    } else {
-      cout << "busy"<<endl;
-    }
-    
   } else {
     cout << "no buffer"<<endl;
   }
index 6be6657..4629830 100644 (file)
@@ -47,6 +47,7 @@ TObject * AliEveEventBufferHomer::GetEventFromSource() {
   if(fHomer) {
     cout << "calling nexthomerevent"<<endl;
     TList * blockList = fHomer->NextHOMEREvent();
+    cout  << "getting async block list"<<endl;
     TList * aList = fHomer->GetAsyncBlockList();
     fAsyncList = aList;
     if(blockList)  return dynamic_cast<TObject*>(blockList);