Skip to content

Commit 991add1

Browse files
rbxmatthiasrichter
authored andcommitted
blind attempt to fix false termination issue
1 parent 2cde463 commit 991add1

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

devices/aliceHLTwrapper/WrapperDevice.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,12 @@ void WrapperDevice::Run()
156156

157157
rateLogger.interrupt();
158158
rateLogger.join();
159+
160+
Shutdown();
161+
162+
boost::lock_guard<boost::mutex> lock(fRunningMutex);
163+
fRunningFinished = true;
164+
fRunningCondition.notify_one();
159165
}
160166

161167
void WrapperDevice::Pause()

devices/aliceHLTwrapper/aliceHLTWrapper.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,11 @@ int main(int argc, char** argv)
172172
device.ChangeState(FairMQDevice::SETINPUT);
173173
device.ChangeState(FairMQDevice::RUN);
174174

175-
char ch;
176-
cin.get(ch);
175+
boost::unique_lock<boost::mutex> lock(device.fRunningMutex);
176+
while (!device.fRunningFinished)
177+
{
178+
device.fRunningCondition.wait(lock);
179+
}
177180

178181
device.ChangeState(FairMQDevice::STOP);
179182
device.ChangeState(FairMQDevice::END);

0 commit comments

Comments
 (0)