mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
Fix race condition in the state machine & channel.
This commit is contained in:
@@ -539,6 +539,7 @@ bool FairMQChannel::InitCommandInterface(FairMQTransportFactory* factory, int nu
|
||||
|
||||
void FairMQChannel::ResetChannel()
|
||||
{
|
||||
boost::unique_lock<boost::mutex> scoped_lock(fChannelMutex);
|
||||
fIsValid = false;
|
||||
// TODO: implement channel resetting
|
||||
}
|
||||
|
@@ -133,6 +133,7 @@ void FairMQStateMachine::WaitForEndOfState(int event)
|
||||
{
|
||||
fStateCondition.wait(lock);
|
||||
}
|
||||
fStateThread.join();
|
||||
}
|
||||
catch (boost::exception& e)
|
||||
{
|
||||
|
@@ -250,8 +250,8 @@ struct FairMQFSM_ : public msm::front::state_machine_def<FairMQFSM_>
|
||||
template <class EVT, class FSM, class SourceState, class TargetState>
|
||||
void operator()(EVT const&, FSM& fsm, SourceState&, TargetState&)
|
||||
{
|
||||
LOG(STATE) << "RUNNING state finished without an external event, going to IDLE";
|
||||
|
||||
LOG(STATE) << "RUNNING state finished without an external event";
|
||||
LOG(STATE) << "Entering READY state";
|
||||
fsm.fState = READY;
|
||||
}
|
||||
};
|
||||
@@ -380,7 +380,7 @@ struct FairMQFSM_ : public msm::front::state_machine_def<FairMQFSM_>
|
||||
std::size_t pos = stateName.find("_FSME");
|
||||
stateName.erase(pos);
|
||||
|
||||
if (stateName == "1RUNNING" || stateName == "6DEVICE_READY" || stateName == "0PAUSED")
|
||||
if (stateName == "1RUNNING" || stateName == "6DEVICE_READY" || stateName == "0PAUSED" || stateName == "8RESETTING_TASK")
|
||||
{
|
||||
stateName = stateName.substr(1);
|
||||
}
|
||||
|
@@ -18,6 +18,7 @@
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
#include <chrono>
|
||||
#include <set>
|
||||
|
||||
using namespace std;
|
||||
using namespace dds::intercom_api;
|
||||
|
Reference in New Issue
Block a user