mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +00:00
Fix missing session name resize if running without FairMQProgOptions
This commit is contained in:
parent
efdec0f6ba
commit
2c2770204f
|
@ -35,7 +35,7 @@ FairMQ::Transport FairMQTransportFactorySHM::fTransportType = FairMQ::Transport:
|
||||||
|
|
||||||
FairMQTransportFactorySHM::FairMQTransportFactorySHM(const string& id, const FairMQProgOptions* config)
|
FairMQTransportFactorySHM::FairMQTransportFactorySHM(const string& id, const FairMQProgOptions* config)
|
||||||
: FairMQTransportFactory(id)
|
: FairMQTransportFactory(id)
|
||||||
, fSessionName()
|
, fSessionName("default")
|
||||||
, fContext(nullptr)
|
, fContext(nullptr)
|
||||||
, fHeartbeatSocket(nullptr)
|
, fHeartbeatSocket(nullptr)
|
||||||
, fHeartbeatThread()
|
, fHeartbeatThread()
|
||||||
|
@ -62,8 +62,6 @@ FairMQTransportFactorySHM::FairMQTransportFactorySHM(const string& id, const Fai
|
||||||
{
|
{
|
||||||
numIoThreads = config->GetValue<int>("io-threads");
|
numIoThreads = config->GetValue<int>("io-threads");
|
||||||
fSessionName = config->GetValue<string>("session");
|
fSessionName = config->GetValue<string>("session");
|
||||||
fSessionName.resize(8, '_'); // shorten the session name, to accommodate for name size limit on some systems (MacOS)
|
|
||||||
// fSegmentName = "fmq_shm_" + fSessionName + "_main";
|
|
||||||
segmentSize = config->GetValue<size_t>("shm-segment-size");
|
segmentSize = config->GetValue<size_t>("shm-segment-size");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -71,6 +69,8 @@ FairMQTransportFactorySHM::FairMQTransportFactorySHM(const string& id, const Fai
|
||||||
LOG(warn) << "FairMQProgOptions not available! Using defaults.";
|
LOG(warn) << "FairMQProgOptions not available! Using defaults.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fSessionName.resize(8, '_'); // shorten the session name, to accommodate for name size limit on some systems (MacOS)
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
fShMutex = fair::mq::tools::make_unique<bipc::named_mutex>(bipc::open_or_create, std::string("fmq_shm_" + fSessionName + "_mutex").c_str());
|
fShMutex = fair::mq::tools::make_unique<bipc::named_mutex>(bipc::open_or_create, std::string("fmq_shm_" + fSessionName + "_mutex").c_str());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user