1 write to _itemsByPriority
Microsoft.CodeAnalysis.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (1)
84
_itemsByPriority
= new HashSet<TItem>[maximumPriority + 1];
24 references to _itemsByPriority
Microsoft.CodeAnalysis.Analyzers (24)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (24)
62
/// Task kicked off to do the next batch of processing of <see cref="
_itemsByPriority
"/>. These
69
/// of items in <see cref="
_itemsByPriority
"/> If there is an existing in flight task, we don't need to
90
for (var i = 0; i <
_itemsByPriority
.Length; i++)
91
_itemsByPriority
[i] = new HashSet<TItem>(equalityComparer);
98
if (priority < 0 || priority >=
_itemsByPriority
.Length)
99
throw new ArgumentOutOfRangeException(paramName: nameof(priority), message: $"Priority must be between 0 and {
_itemsByPriority
.Length - 1}");
117
if (newPriority < 0 || newPriority >=
_itemsByPriority
.Length)
118
throw new ArgumentOutOfRangeException(paramName: nameof(newPriority), message: $"Priority must be between 0 and {
_itemsByPriority
.Length - 1}");
137
if (newPriority < 0 || newPriority >=
_itemsByPriority
.Length)
138
throw new ArgumentOutOfRangeException(paramName: nameof(newPriority), message: $"Priority must be between 0 and {
_itemsByPriority
.Length - 1}");
145
for (var priorityToCheck =
_itemsByPriority
.Length - 1; priorityToCheck > newPriority; priorityToCheck--)
147
if (
_itemsByPriority
[priorityToCheck].Remove(item))
149
Contract.ThrowIfFalse(
_itemsByPriority
[newPriority].Add(item));
162
for (var priorityToCheck =
_itemsByPriority
.Length - 1; priorityToCheck >= 0; priorityToCheck--)
164
if (
_itemsByPriority
[priorityToCheck].Contains(item))
171
Contract.ThrowIfFalse(
_itemsByPriority
[priorityToCheck].Remove(item));
172
Contract.ThrowIfFalse(
_itemsByPriority
[priority].Add(item));
178
return addIfUnscheduled &&
_itemsByPriority
[priority].Add(item);
224
if (
_itemsByPriority
.All(static s => s.Count == 0))
241
if (
_itemsByPriority
.Any(static s => s.Count > 0))
257
for (var priorityToCheck =
_itemsByPriority
.Length - 1; priorityToCheck >= 0; priorityToCheck--)
259
var items =
_itemsByPriority
[priorityToCheck];
286
for (var i = 0; i <
_itemsByPriority
.Length; i++)
287
_itemsByPriority
[i].Clear();