What does errno 36 (EDEADLK) mean?

 
Could be also:
ConstantTypeOS
ERROR_SHARING_BUFFER_EXCEEDEDWin32 errorWindows
KERN_NOT_DEPRESSEDKern returnMac
ippStsNotSupportedCpuIntel Ipp StatusAny
ENAMETOOLONGerrnoLinux
EINPROGRESSerrnoMac
EIDRMerrnoSolaris
NTFS_FILE_SYSTEMBugCheck CodeWindows
Previous Next
EAGAIN ENAMETOOLONG

EDEADLK

EDEADLK identifies a locking request that cannot be granted because doing so would create a deadlock. The status is about the dependency graph, not merely a slow lock: a thread may already own a conflicting lock, or several execution paths may form a cycle through separate locks.

Do not infer native Windows synchronization behavior from the macro alone. Win32 wait and lock APIs have their own documented return channels. This UCRT value is most useful at a C or POSIX-compatible API boundary, where the caller must retain the operation and lock identity that produced it.

Evidence needed to find the cycle

  • Record each lock's stable identifier, mode, owner thread, acquisition time, and the call site that requested the next lock.
  • Check for self-deadlock caused by a non-recursive mutex being acquired twice on the same path.
  • Compare lock order across all participating code paths; a consistent global order prevents the common A-then-B / B-then-A cycle.
  • Do not “fix” the condition by blindly retrying. A stable cycle will recur until ownership, nesting, or ordering changes.

References


Looking for a different code? Search another status or error code.