Skip to content

Commit

Permalink
Commented logging statements used to debug possible locking issue, th…
Browse files Browse the repository at this point in the history
…ese generated too much logspam.
  • Loading branch information
boranblok committed May 9, 2018
1 parent a30f30c commit 6c9c81c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions nntpPoster/PostingThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private void PostingTask()
log.DebugFormat("No message to post, checking cleanup.");
if (_client != null) //If the queue runs dry we close the connection
{
log.DebugFormat("The posting client is not null.");
//log.DebugFormat("The posting client is not null.");
if ((DateTime.Now - lastMessage).TotalMilliseconds > 5000) //TODO: parametrize.
{
log.Debug("Disposing client because of empty queue.");
Expand All @@ -98,36 +98,36 @@ private void PostingTask()
}
else
{
log.DebugFormat("Sleeping 100ms before next loop.");
//log.DebugFormat("Sleeping 100ms before next loop.");
Thread.Sleep(100);
}
}
if (StopRequested)
{
log.Debug("Empty queue and stop requested, Finished = true.");
//log.Debug("Empty queue and stop requested, Finished = true.");
Finished = true;
}
else
{
log.Debug("Locking monitor.");
//log.Debug("Locking monitor.");
lock (monitor)
{
log.Debug("Locked monitor.");
//log.Debug("Locked monitor.");
if (Finished)
{
log.Debug("Finished = true breaking out of loop.");
//.Debug("Finished = true breaking out of loop.");
break;
}
if (StopRequested)
{
log.Debug("Empty queue and stop requested, Finished = true.");
//log.Debug("Empty queue and stop requested, Finished = true.");
Finished = true;
break;
}
log.Debug("waiting 100 ms on monitor.");
//log.Debug("waiting 100 ms on monitor.");
Monitor.Wait(monitor, 100); //TODO: BLB Possible cause of locking issue by UNI.
}
log.Debug("Unlocked monitor.");
//log.Debug("Unlocked monitor.");
}
}
log.DebugFormat("Finished cleanup.");
Expand Down

0 comments on commit 6c9c81c

Please sign in to comment.