Win32 Named mutex not released when process crashes

前端 未结 2 1733
你的背包
你的背包 2020-12-14 23:45

I have 2 processes (A, B) sharing the same mutex (using WaitForSingleObject / ReleaseMutex calls). Everything works fine, but when process A crashes, process B is humming al

2条回答
  •  [愿得一人]
    2020-12-15 00:12

    If the process holding the mutex crashes, then it becomes abandoned. It's up to the other application how it deals with this state returned from the wait functions.

    If it gets WAIT_ABANDONED back then it can either carry on as if all was ok (presumably what it does now) or "potentially unstable data, proceed with caution". The ownership is not passed to another process automatically.

提交回复
热议问题