2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2026-06-13 22:48:42 +00:00

Queue test

This commit is contained in:
2026-06-05 18:10:53 +03:00
parent 8723031e93
commit f1bbe8b6cd
4 changed files with 50 additions and 11 deletions
+4 -1
View File
@@ -93,6 +93,9 @@ public class AsyncQueue<T> : AsyncReply<T>
}
public void Add(AsyncReply<T> reply)
=> Add(reply, !reply.Ready);
public void Add(AsyncReply<T> reply, bool hasResource)
{
lock (queueLock)
{
@@ -103,7 +106,7 @@ public class AsyncQueue<T> : AsyncReply<T>
NotificationsCountWaitingInTheQueueAtEnqueueing = list.Count,
Reply = reply,
Arrival = DateTime.Now,
HasResource = !reply.Ready
HasResource = hasResource
});
}