Revert 156 revert 151 sk/no libuv sushi#157
Conversation
Codecov Report
@@ Coverage Diff @@
## master #157 +/- ##
==========================================
- Coverage 93.02% 91.10% -1.93%
==========================================
Files 5 5
Lines 516 472 -44
==========================================
- Hits 480 430 -50
- Misses 36 42 +6
Continue to review full report at Codecov.
|
| isopen(multi.timer) && done!(multi) | ||
| multi.timer = Timer(multi.grace/1000) do | ||
| lock(multi.lock) do | ||
| isopen(multi.timer) && done!(multi) |
There was a problem hiding this comment.
Is the isopen check necessary? You had mentioned that the isopen test was already done by the callback form of this. Or is it necessary because it might have been closed between when the timer fires and the done! call?
There was a problem hiding this comment.
Yes, it is necessary both because it might have closed while we were waiting for the lock, and because the callback form does not check this.
There was a problem hiding this comment.
Ah, I misunderstood then.
There was a problem hiding this comment.
I might have said it wrong too
e76ef88 to
43a3484
Compare
| done!(multi) | ||
| elseif 0 < multi.grace < typemax(multi.grace) | ||
| uv_timer_start(multi.timer, cleanup_cb, multi.grace, 0) | ||
| multi.timer = Timer(multi.grace/1000) do |
| uv_timer_start(multi.timer, cleanup_cb, multi.grace, 0) | ||
| multi.timer = Timer(multi.grace/1000) do | ||
| lock(multi.lock) do | ||
| isopen(multi.timer) && done!(multi) |
There was a problem hiding this comment.
This needs to check t, not multi.timer
There was a problem hiding this comment.
Just editing on Github, so I might have made some typos. There was lock-acquires missing in the
@async/ Timer blocks of code.