shm_container icon indicating copy to clipboard operation
shm_container copied to clipboard

shmqueue init for read bug

Open yizhiren opened this issue 1 year ago • 0 comments

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));
  }

yizhiren avatar Aug 10 '23 09:08 yizhiren