Lock mapped shared memory for audio buffers

This commit is contained in:
Robbert van der Helm
2021-06-10 01:35:43 +02:00
parent a3aaeaa9a9
commit 5a38a2e482
+3 -2
View File
@@ -22,8 +22,9 @@ AudioShmBuffer::AudioShmBuffer(const Config& config)
config.name.c_str(),
boost::interprocess::read_write) {
shm.truncate(config.size);
buffer = boost::interprocess::mapped_region(
shm, boost::interprocess::read_write, 0, config.size);
buffer =
boost::interprocess::mapped_region(shm, boost::interprocess::read_write,
0, config.size, nullptr, MAP_LOCKED);
}
AudioShmBuffer::~AudioShmBuffer() noexcept {