Skip to content

Commit f195a59

Browse files
committed
Manually remove pda and channel locks after eol
1 parent 0a2baf9 commit f195a59

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/DmaChannelBase.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
///
44
/// \author Pascal Boeschoten ([email protected])
55

6+
#include <boost/filesystem.hpp>
67
#include "DmaChannelBase.h"
78
#include <iostream>
89
#include "ChannelPaths.h"
@@ -85,6 +86,11 @@ DmaChannelBase::DmaChannelBase(CardDescriptor cardDescriptor, const Parameters&
8586
DmaChannelBase::~DmaChannelBase()
8687
{
8788
log("Releasing DMA channel lock", InfoLogger::InfoLogger::Debug);
89+
90+
std::string channelLockPath = "/dev/shm/AliceO2_RoC_" + std::string(getCardDescriptor().pciAddress.toString()) + "_Channel_" + std::to_string((int) getChannelNumber ()) + ".lock";
91+
std::string channelMutexPath = "/dev/shm/sem.AliceO2_RoC_" + std::string(getCardDescriptor().pciAddress.toString()) + "_Channel_" + std::to_string((int) getChannelNumber ()) + "_Mutex";
92+
bfs::remove(channelLockPath);
93+
bfs::remove(channelMutexPath);
8894
}
8995

9096
void DmaChannelBase::log(const std::string& message, boost::optional<InfoLogger::InfoLogger::Severity> severity)

src/Pda/PdaLock.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#define ALICEO2_SRC_READOUTCARD_PDA_PDALOCK_H_
88

99
#include "InterprocessLock.h"
10+
#include "boost/filesystem.hpp"
1011

1112
namespace AliceO2 {
1213
namespace roc {
@@ -27,6 +28,12 @@ class PdaLock
2728
{
2829
}
2930

31+
~PdaLock()
32+
{
33+
boost::filesystem::remove("/dev/shm/AliceO2_RoC_Pda.lock");
34+
boost::filesystem::remove("/dev/shm/sem.AliceO2_RoC_Pda_Mutex");
35+
}
36+
3037
private:
3138
Interprocess::Lock mLock;
3239
};
@@ -35,4 +42,4 @@ class PdaLock
3542
} // namespace roc
3643
} // namespace AliceO2
3744

38-
#endif // ALICEO2_SRC_READOUTCARD_PDA_PDALOCK_H_
45+
#endif // ALICEO2_SRC_READOUTCARD_PDA_PDALOCK_H_

0 commit comments

Comments
 (0)