临时开启时需要跳过最近一轮休眠,跳过以后需要关闭开关,否则会导致一直跳过休眠
This commit is contained in:
parent
86fbdef4bd
commit
802b9bc153
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue