Once I call ReleaseSemaphore(), can I re-OpenSemaphore() the Semaphore object without the need of calling for CreateSemaphore() again?
btw, can I use the same Semaphore for more than one thread? Or should I create a Semaphore per thread?
Thank you.
This is a discussion on what does ReleaseSemaphore() releases? within the Windows Programming forums, part of the Platform Specific Boards category; Once I call ReleaseSemaphore(), can I re-OpenSemaphore() the Semaphore object without the need of calling for CreateSemaphore() again? btw, can ...
Once I call ReleaseSemaphore(), can I re-OpenSemaphore() the Semaphore object without the need of calling for CreateSemaphore() again?
btw, can I use the same Semaphore for more than one thread? Or should I create a Semaphore per thread?
Thank you.
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
>> Once I call ReleaseSemaphore(), can I re-OpenSemaphore() the Semaphore object without the need of calling for CreateSemaphore() again? <<
A semaphore is destroyed once all handles to it are destroyed, either explicitly with CloseHandle or implicitly by process termination. ReleaseSemaphore increases the count of a semaphore. It does not close a semaphore. You do not need to call OpenSemaphore, a semaphore handle remains valid until you close it.
>> btw, can I use the same Semaphore for more than one thread? <<
Yes. There would be little point in using a semaphore with a single thread.
I'm sorry I had to post about this again, it's just no one looked at the older posts anymore.CreateSemaphore() again? <<
Can you please explain alittle more about the count.ReleaseSemaphore increases the count of a semaphore
Also, do I really need the CreateSemaphore(), can't I only use the OpenSemaphore()?
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.