Re: What causes "Too many posts were made to a semaphore"?
From: Jochen Kalmbach (nospam-Jochen.Kalmbach_at_holzma.de)
Date: 02/29/04
- Next message: Jochen Kalmbach: "Re: SetProcessAffinityMask immediate?"
- Previous message: Tim Robinson: "Re: Instance Handle in Console Application"
- In reply to: Peter Steele: "What causes "Too many posts were made to a semaphore"?"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 29 Feb 2004 12:09:56 -0800
Peter Steele wrote:
> Error no. 298, Too many posts were made to a semaphore.
>
> on a call to WaitForSingleObject(). This is happening on a Windows 2000
> system. What might be causing this failure?
The following code will produce this error:
HANDLE hSem = CreateSemaphore(NULL, 0, 10, NULL);
BOOL bRet = ReleaseSemaphore(hSem, 11, NULL);
DWORD gle = GetLastError(); // => 298
As you can see the max value in the "Create" was 10,
Now we released with 11; which is greater than 10...
-- Greetings Jochen Do you need a memory-leak finder ? http://www.codeproject.com/tools/leakfinder.asp
- Next message: Jochen Kalmbach: "Re: SetProcessAffinityMask immediate?"
- Previous message: Tim Robinson: "Re: Instance Handle in Console Application"
- In reply to: Peter Steele: "What causes "Too many posts were made to a semaphore"?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|