Index: /trunk/FACT++/src/EventBuilderWrapper.h
===================================================================
--- /trunk/FACT++/src/EventBuilderWrapper.h	(revision 18616)
+++ /trunk/FACT++/src/EventBuilderWrapper.h	(revision 18617)
@@ -352,7 +352,5 @@
     bool IsThreadRunning()
     {
-        if (fThreadMain.get_id()==boost::this_thread::get_id())
-            return true;
-        return !fThreadMain.timed_join(boost::posix_time::microseconds(0));
+        return fThreadMain.joinable();
     }
 
@@ -382,4 +380,11 @@
 
         fThreadMain = boost::thread(StartEvtBuild);
+
+        // Run a detached thread which ensures that our thread
+        // is joined so that it is not joinable anymore once
+        // it is finished (I think this is similar to
+        // boost::thread_guard, but I could not figure out
+        // how it works)
+        std::thread([this] { this->fThreadMain.join(); }).detach();
     }
 
