1
This commit is contained in:
parent
fe7fe5c62e
commit
925f11416a
@ -122,40 +122,34 @@ bool App::Init(int argc, char* argv[])
|
||||
if (getenv("is_dev_env")) {
|
||||
perf_log_time = 1000 * 10;
|
||||
}
|
||||
#if 0
|
||||
f8::Timer::Instance()->AddRepeatTimer(perf_log_time,
|
||||
a8::XParams(),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
SavePerfLog();
|
||||
});
|
||||
#endif
|
||||
f8::Timer::Instance()->SetInterval
|
||||
(perf_log_time,
|
||||
[] (int event, const a8::Args* args)
|
||||
{
|
||||
SavePerfLog();
|
||||
});
|
||||
}
|
||||
if (HasFlag(1)) {
|
||||
#if 0
|
||||
f8::Timer::Instance()->AddDeadLineTimer(
|
||||
1000 * 60,
|
||||
a8::XParams(),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
App::Instance()->terminated = true;
|
||||
App::Instance()->NotifyLoopCond();
|
||||
}
|
||||
);
|
||||
#endif
|
||||
f8::Timer::Instance()->SetTimeout
|
||||
(
|
||||
1000 * 60,
|
||||
[] (int event, const a8::Args* args)
|
||||
{
|
||||
App::Instance()->terminated = true;
|
||||
App::Instance()->NotifyLoopCond();
|
||||
}
|
||||
);
|
||||
}
|
||||
if (HasFlag(4)) {
|
||||
#if 0
|
||||
a8::Timer::Instance()->AddDeadLineTimer(
|
||||
1000 * 30,
|
||||
a8::XParams(),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
App::Instance()->shutdowned = true;
|
||||
a8::XPrintf("shutdowned\n", {});
|
||||
}
|
||||
);
|
||||
#endif
|
||||
f8::Timer::Instance()->SetTimeout
|
||||
(
|
||||
1000 * 30,
|
||||
[] (int event, const a8::Args* args)
|
||||
{
|
||||
App::Instance()->shutdowned = true;
|
||||
a8::XPrintf("shutdowned\n", {});
|
||||
}
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -253,7 +247,10 @@ void App::Schedule()
|
||||
{
|
||||
std::unique_lock<std::mutex> lk(*loop_mutex_);
|
||||
if (!HasTask()) {
|
||||
#if 0
|
||||
#if 1
|
||||
int sleep_time = 1;
|
||||
loop_cond_->wait_for(lk, std::chrono::milliseconds(sleep_time));
|
||||
#else
|
||||
int sleep_time = f8::Timer::Instance()->GetIdleableMillSeconds();
|
||||
loop_cond_->wait_for(lk, std::chrono::milliseconds(sleep_time));
|
||||
if (sleep_time > perf.max_timer_idle) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user