Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

Go API

constant libtmux-go latest

WaitForModeLock

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

Source and package
Qualified name
tmux.WaitForModeLock
Package
tmux
Distribution
github.com/libtmux/libtmux-go/tmux
Source
tmux/server_exec.go
WaitForModeLock : WaitForMode

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.

Esc

Type to search.

Reference previewOpen reference