mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Set woken flag when flushing so that the channel is freed, while here
use the same loop construct for both loops.
This commit is contained in:
		@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user