Skip to content
Browse files

Adding additional logging statements

  • Loading branch information...
1 parent b12ecef commit a9d90c25238504bd26f45b182d65bc61d8e4aee5 @ayende ayende committed
Showing with 5 additions and 2 deletions.
  1. +5 −2 Raven.Database/Indexing/WorkContext.cs
View
7 Raven.Database/Indexing/WorkContext.cs
@@ -71,6 +71,7 @@ public bool WaitForWork(TimeSpan timeout, ref int workerWorkCounter, Action befo
workerWorkCounter = currentWorkCounter;
return true;
}
+ log.Debug("Not work was found, workerWorkCounter: {0}, currentWorkCounter: {1}, will wait for additional work", workerWorkCounter, currentWorkCounter);
return Monitor.Wait(waitForWork, timeout);
}
}
@@ -90,11 +91,13 @@ public void HandleWorkNotifications()
public void NotifyAboutWork()
{
- Interlocked.Increment(ref workCounter);
+ int increment = Interlocked.Increment(ref workCounter);
+ log.Debug("Incremented work counter to {0} - step 1/2", increment);
lock (waitForWork)
{
+ increment= Interlocked.Increment(ref workCounter);
+ log.Debug("Incremented work counter to {0} - step 2/2", increment);
Monitor.PulseAll(waitForWork);
- Interlocked.Increment(ref workCounter);
}
}

0 comments on commit a9d90c2

Please sign in to comment.
Something went wrong with that request. Please try again.