# tmux.WaitForModeLock

- **Module:** tmux
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** constant
- **Source:** https://github.com/libtmux/libtmux-go/blob/52968a3181c1c9e6d1b26c565d4b170968ae61c0/tmux/server_exec.go#L103
- **Page:** https://libtmux.org/en/go/latest/reference/tmux-waitformodelock/

WaitForModeLock acquires Channel's tmux mutex, queuing behind another locker if it is already held.

A cancelled or timed-out ctx while queued costs Channel one unlock:
tmux hands the mutex to the next queued client whether or not it is
still there, and the one that has gone cannot pass it on
(cmd-wait-for.c cmd_wait_for_unlock). Unlocking again hands it to the
next real locker, so a channel is not lost, but a program that
abandons lock waits and counts its unlocks will deadlock on its own
arithmetic.
