How do I recover a semaphore when the process that decremented it to zero crashes?

后端 未结 8 560
轻奢々
轻奢々 2020-12-02 13:23

I have multiple apps compiled with g++, running in Ubuntu. I\'m using named semaphores to co-ordinate between different processes.

All works fine except in

8条回答
  •  暖寄归人
    2020-12-02 13:44

    You should be able to find it from the shell using lsof. Then possibly you can delete it?

    Update

    Ah yes... man -k semaphore to the rescue.

    It seems you can use ipcrm to get rid of a semaphore. Seems you aren't the first with this problem.

提交回复
热议问题