go-zeromq / zmq4

[WIP] Pure-Go implementation of ZeroMQ-4
BSD 3-Clause "New" or "Revised" License
341 stars 56 forks source link

Ensure reaperCond is unlocked when context is canceled #107

Closed jwgcarlson closed 3 years ago

jwgcarlson commented 3 years ago

The previous PR (#106) failed to unlock reaperCond.L when the context was done, which causes deadlocks in certain circumstances. The new structure ensures the lock is always released, while also avoiding spurious Lock()/Unlock() calls (note that reaperCond.Wait() atomically unlocks before entering its wait state).

codecov[bot] commented 3 years ago

Codecov Report

Merging #107 (af5e5f9) into master (03db79d) will increase coverage by 0.55%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #107      +/-   ##
==========================================
+ Coverage   67.36%   67.91%   +0.55%     
==========================================
  Files          29       29              
  Lines        1811     1811              
==========================================
+ Hits         1220     1230      +10     
+ Misses        490      481       -9     
+ Partials      101      100       -1     
Impacted Files Coverage Δ
socket.go 83.04% <100.00%> (ø)
rep.go 76.69% <0.00%> (+7.51%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 03db79d...af5e5f9. Read the comment docs.

sbinet commented 3 years ago

thanks a lot.