server.Server.lock_channel
Rust
- Python Unavailable
- TypeScript Unavailable
- Rust
- Go Unavailable
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- server
- Declared in
- Server
- Package
- libtmux
- Source
- crates/libtmux/src/server/channels.rs
-
Lock a
wait-forchannel, blocking later lock attempts on it.Self::with_channel_lockpairs this with the unlock, which is usually what a caller wants. A lock another locker holds waits for its turn, up toServer::default_timeout.Errors
Returns an error when tmux refuses the channel name, and
crate::ErrorKind::Timeoutwhen the channel is still held afterServer::default_timeout. A handle fromServer::over_control_modeis refused, for the reasonSelf::wait_for_channelgives.Cancel safety
Nothing is left held. The lock is taken in a task of its own, so a lock that is dropped -- or that runs out of time -- while queued behind another locker is not withdrawn from tmux, which cannot withdraw one: it is granted in turn and released at once. Between those two, later lockers wait as they would for any other holder.
Shutting the server down while such a lock is queued is the exception, because it kills the client: tmux then grants the lock to a client that is gone and every later lock on the channel blocks forever. A tmux defect (
cmd_wait_for_unlockincmd-wait-for.c), measured on 3.2a, 3.7d and 3.8-rc.
0 declared, 0 inherited