Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shmqueue init for read bug #9

Open
yizhiren opened this issue Aug 10, 2023 · 0 comments
Open

shmqueue init for read bug #9

yizhiren opened this issue Aug 10, 2023 · 0 comments

Comments

@yizhiren
Copy link

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));
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant