我应该ReleaseSemaphore在以下情况下打电话吗?
HANDLE hSemaphore = OpenSemaphore(SYNCHRONIZE, FALSE, TEXT("Global\\Semaphore"));
DWORD dwWaitResult = WaitForSingleObject(hSemaphore, 0);
if (dwWaitResult != WAIT_OBJECT_0)
{
ReleaseSemaphore(hSemaphore, 1, NULL); // ???
}
该问题的评论中有一个答案:不,它不会减少。