WaitForModeLock
WaitForModeLock acquires Channel's tmux mutex, queuing behind another locker if it is already held.
Source and package
- Qualified name
-
tmux.Wait For Mode Lock - Package
- tmux
- Distribution
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/server_exec.go
- WaitForModeLock : Wait
For Mode -
Description#
Before tmux 3.8, 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. tmux 3.8 drops the wait of a client that has gone (tmux issue 5614), so there an abandoned wait costs nothing and an extra unlock fails.