I want to get the count of a semaphore without tripping the signaled/non-signaled state. But no matter what I can think of, I'd have to do it at one point or another. How can I accomplish this regardless of the maximum value and current value?
I want to get the count of a semaphore without tripping the signaled/non-signaled state. But no matter what I can think of, I'd have to do it at one point or another. How can I accomplish this regardless of the maximum value and current value?
Well, what about managing the semaphore objects inside a class ? I don't know if there's a direct way to get to the count of the semaphore (except with the ReleaseSemaphore function but in this case it's not a valid option), but depending on how you use the semaphore object, it might be a valid option. Or it might not.
I hate real numbers.
I've thought of that, but the whole idea is that my API can handle semaphores created and managed by other programs by use of Win32 API. If I use a class, it'll screw everything up.
Even if there were a "GetSemCount()" function, the returned count would only be a *snapshot* at the point in time the function was called.
So what would you do with that information? Why do you need it?
gg
Windows takes care of the semaphore count and functionality. You just use it.
Yeah... the more I think about it, the more I realize my original idea is in vain. Thanks for replying anyhow.