Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

Update ScheduledThreadPoolExecutor.cs #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Sharpen/Sharpen/ScheduledThreadPoolExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,6 @@ void SchedulerThread ()
{
int nextWait = ST.Timeout.Infinite;
while (true) {
if (nextWait != ST.Timeout.Infinite)
nextWait = Math.Max (0, nextWait);
newTask.WaitOne (nextWait);
lock (tasks) {
DateTime now = DateTime.Now;
Expand All @@ -209,7 +207,7 @@ void SchedulerThread ()
n--;
}
if (n < tasks.Count)
nextWait = (int) Math.Ceiling ((tasks[n].DueTime - DateTime.Now).TotalMilliseconds);
nextWait = Math.Max (0, (int) Math.Ceiling ((tasks[n].DueTime - DateTime.Now).TotalMilliseconds));
else
nextWait = ST.Timeout.Infinite;
}
Expand Down