You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The fastest way to wait for completion is to spin a bit before waiting on the event. This is the same logic that Task.GetAwaiter().GetResult() uses.
36
+
varspinner=newSpinWait();
37
+
while(!resetEvent.IsSet)
39
38
{
40
-
awaiterCompleted=false;
41
-
awaiter.UnsafeOnCompleted(awaiterCallback);
42
-
// Check if the callback executed synchronously before blocking.
// The fastest way to wait for completion is to spin a bit before waiting on the event. This is the same logic that Task.GetAwaiter().GetResult() uses.
54
+
varspinner=newSpinWait();
55
+
while(!resetEvent.IsSet)
53
56
{
54
-
awaiterCompleted=false;
55
-
awaiter.UnsafeOnCompleted(awaiterCallback);
56
-
// Check if the callback executed synchronously before blocking.
// This is used to test the case of ValueTaskAwaiter.IsCompleted returns false, then OnCompleted invokes the callback immediately because it happened to complete between the 2 calls.
0 commit comments