I'm writing a asynchronous library using begin/end, and I need to lock objects.

Currently, I'm doing this using semaphores, but calling `semaphore.WaitOne()` suspends the thread where it is called. I'd rather use something like BeginWait so it would return immediately and call the callback function when the semaphore is free.

Is there such an object in c#?