# cmd_wait_for_lock

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-wait-for.c#L196
- **Page:** https://libtmux.org/en/tmux/latest/reference/c-function-cmd-wait-for-c-cmd_wait_for_lock/

```c
static enum cmd_retval cmd_wait_for_lock(struct cmdq_item *, const char *, struct wait_channel *)
```

## Parameters

- `item` (`struct cmdq_item *`)
- `name` (`const char *`)
- `wc` (`struct wait_channel *`)

## Called by

- [`cmd_wait_for_exec`](/en/tmux/latest/reference/c-function-cmd-wait-for-c-cmd_wait_for_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-wait-for.c#L133)

## Calls

- [`cmd_wait_for_add`](/en/tmux/latest/reference/c-function-cmd-wait-for-c-cmd_wait_for_add/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-wait-for.c#L207)
- [`cmdq_error`](/en/tmux/latest/reference/c-function-cmdq_error/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-wait-for.c#L202)
- [`cmdq_get_client`](/en/tmux/latest/reference/c-function-cmdq_get_client/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-wait-for.c#L201)
- [`xcalloc`](/en/tmux/latest/reference/c-function-xcalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-wait-for.c#L210)

## Referenced declarations

- [`CMD_RETURN_ERROR`](/en/tmux/latest/reference/c-enum-cmd_retval-cmd_return_error/) (constant)
- [`CMD_RETURN_NORMAL`](/en/tmux/latest/reference/c-enum-cmd_retval-cmd_return_normal/) (constant)
- [`CMD_RETURN_WAIT`](/en/tmux/latest/reference/c-enum-cmd_retval-cmd_return_wait/) (constant)
- [`cmd_retval`](/en/tmux/latest/reference/c-enum-cmd_retval/) (enum)
- [`cmdq_item`](/en/tmux/latest/reference/c-struct-cmdq_item/) (struct)
- [`wait_item.entry`](/en/tmux/latest/reference/c-struct-wait_item-entry/) (attribute)
- [`wait_item.item`](/en/tmux/latest/reference/c-struct-wait_item-item/) (attribute)
- [`wait_channel.locked`](/en/tmux/latest/reference/c-struct-wait_channel-locked/) (attribute)
- [`wait_channel.lockers`](/en/tmux/latest/reference/c-struct-wait_channel-lockers/) (attribute)
- [`wait_channel`](/en/tmux/latest/reference/c-struct-wait_channel/) (struct)
