Skip to content
Snippets Groups Projects

Check

Merged Recolic requested to merge check into pa2
2 files
+ 18
9
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 12
8
@@ -41,11 +41,6 @@ static void timer_sig_handler(int signum) {
}
void device_update_impl() {
// async
if(device_update_flag)
device_update_flag = false;
else
return;
if (update_screen_flag) {
update_screen();
update_screen_flag = false;
@@ -75,9 +70,16 @@ void device_update_impl() {
}
}
void device_update() {device_update_impl();}
void device_update() {
#ifdef ENABLE_ASYNC_RENDER
#else
if(device_update_flag.exchange(false)) {
device_update_impl();
}
#endif
}
static void device_update_thread_daemon() {
[[maybe_unused]] static void device_update_thread_daemon() {
while(true) {
if(device_update_flag.exchange(false)) {
device_update_impl();
@@ -109,7 +111,9 @@ void init_device() {
ret = setitimer(ITIMER_VIRTUAL, &it, NULL);
Assert(ret == 0, "Can not set timer");
// std::thread(device_update_thread_daemon).detach();
#ifdef ENABLE_ASYNC_RENDER
std::thread(device_update_thread_daemon).detach();
#endif
}
#else
Loading