shm_container
shm_container copied to clipboard
shmqueue init for read bug
you call InitForWrite in ShmQueue<Alloc>::InitForRead, i think this is a bug.
template <class Alloc>
bool ShmQueue<Alloc>::InitForRead(const std::string& shm_key) {
if (shm_.is_initialized()) {
SHMC_ERR_RET("ShmQueue::InitForRead: already initialized\n");
}
if (!shm_.InitForWrite(shm_key, sizeof(ShmHead), kNoCreate)) {
SHMC_ERR_RET("ShmQueue::InitForRead: shm_.InitForRead(%s, %lu) fail\n",
shm_key.c_str(), sizeof(ShmHead));
}