临时开启时需要跳过最近一轮休眠,跳过以后需要关闭开关,否则会导致一直跳过休眠

This commit is contained in:
大石头X2 2017-01-06 15:09:28 +08:00
parent 86fbdef4bd
commit 802b9bc153
1 changed files with 4 additions and 3 deletions

View File

@ -373,15 +373,16 @@ void TaskScheduler::Execute(uint msMax, bool& cancel)
now = Sys.Ms(); // 当前时间
if(/*msMax == 0xFFFFFFFF &&*/ !_SkipSleep && min != UInt64_Max && min > now)
{
min -= now;
Sleeping = true;
min -= now;
Sleeping = true;
Time.Sleep(min, &Sleeping);
Sleeping = false;
Sleeping = false;
// 累加睡眠时间
Int64 ms = (Int64)Sys.Ms() - (Int64)now;
TotalSleep += ms;
}
_SkipSleep = false;
}
uint TaskScheduler::ExecuteForWait(uint msMax, bool& cancel)