Skip to content

Commit

Permalink
Only appened response status if request.wait()
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisMontagne committed Mar 8, 2019
1 parent 2044042 commit ab4d0f0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,13 @@ func (ch *Channel) call(ctx context.Context, req message, res ...message) error
return err
}

var status uint32
if req.wait() {
var status uint32

ch.responsesM.Lock()
ch.responses = append(ch.responses, &status)
ch.responsesM.Unlock()
ch.responsesM.Lock()
ch.responses = append(ch.responses, &status)
ch.responsesM.Unlock()

if req.wait() {
select {
case <-ctx.Done():
atomic.StoreUint32(&status, 1)
Expand Down

0 comments on commit ab4d0f0

Please sign in to comment.