Skip to content

Commit

Permalink
Merge pull request #14 from ifplusor/fix-get-cqe
Browse files Browse the repository at this point in the history
fix: return copy of CQE
  • Loading branch information
Iceber authored Jun 9, 2022
2 parents 30825ba + 39243c5 commit b1dc8dd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions iouring.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,10 @@ func (iour *IOURing) getCQEvent(wait bool) (cqe *iouring_syscall.CompletionQueue
var tryPeeks int
for {
if cqe = iour.cq.peek(); cqe != nil {
// Copy CQE.
cqe2 := *cqe
iour.cq.advance(1)
cqe = &cqe2
return
}

Expand Down

0 comments on commit b1dc8dd

Please sign in to comment.