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
/// <c>true</c> if the <see cref="_isProcessing"/> flag should be released
422
+
/// by the caller; <c>false</c> if the flag must remain held because
423
+
/// processing is pending a dependency completing.
424
+
/// </returns>
425
+
publicboolProcessChange()
417
426
{
418
427
if(string.IsNullOrWhiteSpace(Path))
419
428
{
420
-
return;
429
+
returntrue;
421
430
}
422
431
423
432
_queue??=newConcurrentQueue<ChangeInfo>();
424
433
425
434
if(_queue.IsEmpty)
426
435
{
427
-
Initialize();
428
436
Thread.Sleep(EMPTY_QUEUE_SLEEP_MS);
429
-
return;
437
+
returntrue;
430
438
}
431
439
432
440
// Peek at first item for correlation ID instead of copying entire queue
@@ -470,7 +478,10 @@ public void ProcessChange()
470
478
$"{correlationPrefix}{IdLogString}: Watch blocked from running. Reason: {reason}. Queue will be processed when watch becomes available. (Watch.ProcessChange)",
471
479
LogLevel.DEBUG);
472
480
}
473
-
return;
481
+
// Return false to keep _isProcessing held. OnNeedsCompleted will call
482
+
// ProcessChange() directly once the dependency completes, at which point
483
+
// it will release _isProcessing itself.
484
+
returnfalse;
474
485
}
475
486
476
487
varstartTime=DateTime.Now;
@@ -543,6 +554,7 @@ public void ProcessChange()
543
554
?$"[{firstCorrelationId.Value}] {IdLogString}: Tasks completed for watch."
0 commit comments