Skip to content

Commit

Permalink
waitSignalDic.GetOrAdd
Browse files Browse the repository at this point in the history
  • Loading branch information
ZjzMisaka committed Dec 4, 2023
1 parent e9bb9c1 commit 2c6df78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PowerThreadPool/Worker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ internal void SetWork(WorkBase work, bool stolenWork)
{
waitingWorkDic[work.ID] = work;
waitingWorkIDQueue.Enqueue(work.ID, work.WorkPriority);
waitSignalDic[work.ID] = new AutoResetEvent(false);
waitSignalDic.GetOrAdd(work.ID, _ => new AutoResetEvent(false));
Interlocked.Increment(ref waitingWorkCount);
}

Expand Down

0 comments on commit 2c6df78

Please sign in to comment.