Skip to content

Commit b4120ab

Browse files
committed
Merge branch 'master' of github.com:tylertreat/chan
2 parents b925298 + d737162 commit b4120ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/chan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ static int unbuffered_chan_send(chan_t* chan, void* data)
321321

322322
// Block until reader consumed chan->data.
323323
pthread_cond_wait(&chan->w_cond, &chan->m_mu);
324-
chan->w_waiting--;
325324

326325
pthread_mutex_unlock(&chan->m_mu);
327326
pthread_mutex_unlock(&chan->w_mu);
@@ -353,6 +352,7 @@ static int unbuffered_chan_recv(chan_t* chan, void** data)
353352
{
354353
*data = chan->data;
355354
}
355+
chan->w_waiting--;
356356

357357
// Signal waiting writer.
358358
pthread_cond_signal(&chan->w_cond);

0 commit comments

Comments
 (0)