Skip to content

Commit b682fbf

Browse files
ocoanetJPWatson
authored andcommitted
Reset SpinWaitIdleStrategy when work count is zero
1 parent 3a2ad58 commit b682fbf

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Adaptive.Agrona/Concurrent/SpinWaitIdleStrategy.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ public void Idle(int workCount)
2929
{
3030
if (workCount > 0)
3131
{
32-
return;
32+
Reset();
33+
}
34+
else
35+
{
36+
_spinWait.SpinOnce();
3337
}
34-
35-
_spinWait.SpinOnce();
3638
}
3739

3840
public void Idle()

0 commit comments

Comments
 (0)