mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
Fix CID 169525 Data race condition
This commit is contained in:
parent
c78541432f
commit
ec786dce03
|
@ -410,6 +410,20 @@ void FairMQChannel::UpdateRateLogging(const int rateLogging)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto FairMQChannel::SetModified(const bool modified) -> void
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
unique_lock<mutex> lock(fChannelMutex);
|
||||||
|
fModified = modified;
|
||||||
|
}
|
||||||
|
catch (exception& e)
|
||||||
|
{
|
||||||
|
LOG(ERROR) << "Exception caught in FairMQChannel::SetModified: " << e.what();
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool FairMQChannel::IsValid() const
|
bool FairMQChannel::IsValid() const
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
@ -270,6 +270,7 @@ class FairMQChannel
|
||||||
static std::atomic<bool> fInterrupted;
|
static std::atomic<bool> fInterrupted;
|
||||||
bool fMultipart;
|
bool fMultipart;
|
||||||
bool fModified;
|
bool fModified;
|
||||||
|
auto SetModified(const bool modified) -> void;
|
||||||
bool fReset;
|
bool fReset;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ void FairMQDevice::AttachChannels(list<FairMQChannel*>& chans)
|
||||||
if (AttachChannel(**itr))
|
if (AttachChannel(**itr))
|
||||||
{
|
{
|
||||||
(*itr)->InitCommandInterface();
|
(*itr)->InitCommandInterface();
|
||||||
(*itr)->fModified = false;
|
(*itr)->SetModified(false);
|
||||||
chans.erase(itr++);
|
chans.erase(itr++);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user