diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-09-13 10:45:56 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-09-13 10:45:56 +0000 |
commit | 62e19cf3727589d1348cd12ea6b0ce2f181ce79f (patch) | |
tree | 32cc50fbb07962b5282f447dd325ccfaff695565 /usr.bin | |
parent | db922e82dd6dd65717bf94bfcd49cc187ceaf9b6 (diff) |
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')
-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); |