Skip to content

Commit

Permalink
Merge branch 'master' of github.com:tylertreat/chan
Browse files Browse the repository at this point in the history
  • Loading branch information
tylertreat committed Jan 23, 2016
2 parents b925298 + d737162 commit b4120ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ static int unbuffered_chan_send(chan_t* chan, void* data)

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

pthread_mutex_unlock(&chan->m_mu);
pthread_mutex_unlock(&chan->w_mu);
Expand Down Expand Up @@ -353,6 +352,7 @@ static int unbuffered_chan_recv(chan_t* chan, void** data)
{
*data = chan->data;
}
chan->w_waiting--;

// Signal waiting writer.
pthread_cond_signal(&chan->w_cond);
Expand Down

0 comments on commit b4120ab

Please sign in to comment.