In .NET, is there a way to get the count on a semaphore. I don't need a threadsafe count, just a reasonable approximation so report the status on a GUI thread.
Currently I'm using a dual-counter. The real semaphore and another variable that is incremented and decremented in sync, but this is annoying and error prone.