Skip to content

Commit

Permalink
Change fix for Apply in SwitchC.
Browse files Browse the repository at this point in the history
  • Loading branch information
jam40jeff committed Jan 31, 2018
1 parent f0cf4f6 commit c1b2aa0
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions c#/src/Sodium/Sodium/Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,17 +343,18 @@ internal void Send(Action<Transaction> action)

internal void Prioritized(Node node, Action<Transaction> action)
{
Entry e = new Entry(node, action);
lock (Node.NodeRanksLock)
if (this.finishedPriorityQueue)
{
this.prioritizedQueue.Enqueue(e, node.Rank);
this.lastQueue.Add(() => action(this));
}
this.entries.Add(e);

// we have already processed all prioritized items, so run the action now
if (this.finishedPriorityQueue)
else
{
action(this);
Entry e = new Entry(node, action);
lock (Node.NodeRanksLock)
{
this.prioritizedQueue.Enqueue(e, node.Rank);
}
this.entries.Add(e);
}
}

Expand Down

0 comments on commit c1b2aa0

Please sign in to comment.