| Previous | Next |
| ERROR_TOO_MANY_SEMAPHORES | ERROR_SEM_IS_SET |
ERROR_EXCL_SEM_ALREADY_OWNED
What ERROR_EXCL_SEM_ALREADY_OWNED means
An exclusive semaphore is already owned by another execution context. The result describes an ownership conflict rather than a missing object. It is primarily relevant to older synchronization APIs and compatibility code where an exclusive semaphore behaves similarly to a mutex: only one owner may hold it at a time.
Common causes
- Code attempted a non-waiting acquisition while another thread still owned the semaphore
- An error path skipped the matching release operation
- The owner is blocked while waiting for a resource held by the contender
- The application incorrectly treats an exclusive semaphore as a counting semaphore
How to investigate
- Identify the current owner and the call stack on which ownership was obtained
- Measure how long ownership has been held and whether progress is still being made
- Inspect every return, exception, and cancellation path between acquisition and release
- Build a wait-for graph when two or more locks are involved
Developer guidance
Use scoped ownership so release occurs automatically. Keep the protected region small, document lock ordering, and never call unknown callbacks while retaining exclusive ownership.
Administrator and support guidance
Collect a process dump or synchronization trace before terminating the application. The owner stack is usually more valuable than the final failing acquisition.
How this code differs from related results
Unlike ERROR_SEM_OWNER_DIED, this code does not say the owner terminated. It says ownership still exists and prevents the requested exclusive acquisition.
References
Looking for a different code? Search another status or error code.