lower the cpu cost in open-source mini-mode

This commit is contained in:
hnwyllmm
2022-02-17 10:27:48 +08:00
committed by LINxiansheng
parent e03047055d
commit 5f699b5711
2 changed files with 9 additions and 2 deletions

View File

@ -88,6 +88,8 @@ void ObLockWaitMgr::destroy()
void ObLockWaitMgr::run1()
{
const int interval_us = (lib::is_mini_mode() ? 10 : 1000) * 1000;
(void)prctl(PR_SET_NAME, "ObLockWaitMgr", 0, 0, 0);
while (!has_set_stop() || !is_hash_empty()) {
ObLink* iter = check_timeout();
@ -97,7 +99,7 @@ void ObLockWaitMgr::run1()
(void)repost(cur);
}
usleep(10000);
usleep(interval_us);
}
}