Hyprland/src/ManagerThread.cpp

25 lines
518 B
C++
Raw Normal View History

2022-03-17 15:53:45 +01:00
#include "ManagerThread.hpp"
CManagerThread::CManagerThread() {
2022-03-17 20:22:29 +01:00
m_tMainThread = new std::thread([&]() {
2022-03-17 15:53:45 +01:00
// Call the handle method.
this->handle();
});
m_tMainThread->detach(); // detach and continue.
}
CManagerThread::~CManagerThread() {
//
}
void CManagerThread::handle() {
2022-03-17 17:08:54 +01:00
g_pConfigManager->init();
2022-03-17 15:53:45 +01:00
while (3.1415f) {
g_pConfigManager->tick();
std::this_thread::sleep_for(std::chrono::microseconds(1000000 / g_pConfigManager->getInt("max_fps")));
}
}