FairRootGroup/FairRoot — pull request #82 by rbx (2014-09-01 13:28:09+00:00)
Title: Condition check before ending the main thread.

Make sure the main thread waits for the child thread with the Run() method.

* Add this at the end of your Run() method for each device:
```
boost::lock_guard lock(fRunningMutex);
fRunningFinished = true;
fRunningCondition.notify_one();
```
* Then you must replace the `char ch; cin.get(ch);` in your main() function with:
```
boost::unique_lock lock(processor.fRunningMutex);
while (!processor.fRunningFinished)
{
processor.fRunningCondition.wait(lock);
}
```