AutoReleaser
- Updated2025-07-21
- 1 minute(s) read
AutoReleaser
Use the AutoReleaser class to hold a reference with a lifetime that corresponds to a semaphore Acquire operation or a mutex Lock operation. When you release the final reference to the AutoReleaser object, one of the following operations complete:
- When the AutoReleaser is from the Semaphore.AcquireSemaphoreWithAutoReleaser method, a Release operation on the semaphore completes.
- When the AutoReleaser is from the Mutex.LockMutex method, an Unlock operation on the mutex completes.