Skip to content

Commit

Permalink
Merge pull request #5011 from brah-mcdude/dev
Browse files Browse the repository at this point in the history
Update TestScheduler.cs
  • Loading branch information
brah-mcdude authored May 14, 2021
1 parent 3ebbfcf commit 0ef7f07
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/Akka.TestKit/TestScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,14 @@ private void InternalSchedule(TimeSpan? initialDelay, TimeSpan delay, ICanTell r
{
var scheduledTime = _now.Add(initialDelay ?? delay).UtcTicks;

if (!_scheduledWork.TryGetValue(scheduledTime, out var tickItems))
ConcurrentQueue<ScheduledItem> tickItems;
while (!_scheduledWork.TryGetValue(scheduledTime, out tickItems))
{
tickItems = new ConcurrentQueue<ScheduledItem>();
_scheduledWork.TryAdd(scheduledTime, tickItems);
if (_scheduledWork.TryAdd(scheduledTime, tickItems))
{
break;
}
}

var type = message == null ? ScheduledItem.ScheduledItemType.Action : ScheduledItem.ScheduledItemType.Message;
Expand Down

0 comments on commit 0ef7f07

Please sign in to comment.