Skip to content

shmqueue init for read bug #9

@yizhiren

Description

@yizhiren

you call InitForWrite in ShmQueue::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));
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions