Skip to content

Commit

Permalink
the mutex is not unblocked if the queue is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
sotchenkov committed Mar 26, 2024
1 parent 6829c25 commit 8ebf5a4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/server/handlers/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func PopMsg(w http.ResponseWriter, r *http.Request) {

if q.IsEmpty() {
response.Send(w, http.StatusNotFound, response.Error{Error: "empty_queue", Info: "The queue is empty"})
q.Mu.Unlock()
return
}
msg := q.Pop()
Expand Down

0 comments on commit 8ebf5a4

Please sign in to comment.