mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +00:00
Shm: fix region init with external regions
This commit is contained in:
parent
46e568c55e
commit
de09018198
|
@ -395,18 +395,10 @@ class Manager
|
||||||
|
|
||||||
const uint16_t id = cfg.id.value();
|
const uint16_t id = cfg.id.value();
|
||||||
|
|
||||||
UnmanagedRegion* region = nullptr;
|
|
||||||
bool newRegionCreated = false;
|
|
||||||
std::lock_guard<std::mutex> lock(fLocalRegionsMtx);
|
std::lock_guard<std::mutex> lock(fLocalRegionsMtx);
|
||||||
auto res = fRegions.emplace(id, std::make_unique<UnmanagedRegion>(fShmId, size, false, cfg));
|
auto& region = fRegions[id] = std::make_unique<UnmanagedRegion>(fShmId, size, false, cfg);
|
||||||
newRegionCreated = res.second;
|
|
||||||
region = res.first->second.get();
|
|
||||||
// LOG(debug) << "Created region with id '" << id << "', path: '" << cfg.path << "', flags: '" << cfg.creationFlags << "'";
|
// LOG(debug) << "Created region with id '" << id << "', path: '" << cfg.path << "', flags: '" << cfg.creationFlags << "'";
|
||||||
|
|
||||||
if (!newRegionCreated) {
|
|
||||||
region->fRemote = false; // TODO: this should be more clear, refactor it.
|
|
||||||
}
|
|
||||||
|
|
||||||
// start ack receiver only if a callback has been provided.
|
// start ack receiver only if a callback has been provided.
|
||||||
if (callback || bulkCallback) {
|
if (callback || bulkCallback) {
|
||||||
region->SetCallbacks(callback, bulkCallback);
|
region->SetCallbacks(callback, bulkCallback);
|
||||||
|
@ -414,7 +406,7 @@ class Manager
|
||||||
region->StartAckSender();
|
region->StartAckSender();
|
||||||
region->StartAckReceiver();
|
region->StartAckReceiver();
|
||||||
}
|
}
|
||||||
result.first = region;
|
result.first = region.get();
|
||||||
result.second = id;
|
result.second = id;
|
||||||
}
|
}
|
||||||
fRegionsGen += 1; // signal TL cache invalidation
|
fRegionsGen += 1; // signal TL cache invalidation
|
||||||
|
|
Loading…
Reference in New Issue
Block a user