diff options
author | 2015-09-13 10:45:55 +0000 | |
---|---|---|
committer | 2015-09-13 10:45:55 +0000 | |
commit | 523072a58a1d38c41e6dccc3ee9cced02ba18b3b (patch) | |
tree | 7c568dabdf7d1bad83661fad80bdf5384a2e4590 /usr.bin/tmux/cmd-wait-for.c | |
parent | Mechanical minor bump to follow libcrypto. (diff) | |
download | wireguard-openbsd-523072a58a1d38c41e6dccc3ee9cced02ba18b3b.tar.xz wireguard-openbsd-523072a58a1d38c41e6dccc3ee9cced02ba18b3b.zip |
Set woken flag when flushing so that the channel is freed, while here
use the same loop construct for both loops.
Diffstat (limited to 'usr.bin/tmux/cmd-wait-for.c')
-rw-r--r-- | usr.bin/tmux/cmd-wait-for.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-wait-for.c b/usr.bin/tmux/cmd-wait-for.c index 2bdbd594c14..e76336df8ff 100644 --- a/usr.bin/tmux/cmd-wait-for.c +++ b/usr.bin/tmux/cmd-wait-for.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-wait-for.c,v 1.8 2015/09/04 12:02:44 nicm Exp $ */ +/* $OpenBSD: cmd-wait-for.c,v 1.9 2015/09/13 10:45:55 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott <nicm@users.sourceforge.net> @@ -97,7 +97,6 @@ cmd_wait_for_add(const char *name) void cmd_wait_for_remove(struct wait_channel *wc) { - if (wc->locked) return; if (!TAILQ_EMPTY(&wc->waiters) || !wc->woken) @@ -241,7 +240,8 @@ cmd_wait_for_flush(void) if (!cmdq_free(wq)) cmdq_continue(wq); } - while ((wq = TAILQ_FIRST(&wc->lockers)) != NULL) { + wc->woken = 1; + TAILQ_FOREACH_SAFE(wq, &wc->lockers, waitentry, wq1) { TAILQ_REMOVE(&wc->lockers, wq, waitentry); if (!cmdq_free(wq)) cmdq_continue(wq); |