Use OS::delay_usec() to avoid using deprecated usleep() on Linux

usleep(3) was declared obsolete in POSIX.1-2001 and removed in POSIX.1-2008.
nanosleep(2) was recommended to be used instead.

`OS::delay_usec()` internally uses `nanosleep()`.

This also uses large number separators for improved readability.
This commit is contained in:
Hugo Locurcio 2024-05-21 17:32:14 +02:00
parent aaa4560729
commit a008896f70
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
3 changed files with 6 additions and 6 deletions

View file

@ -591,7 +591,7 @@ void FreeDesktopPortalDesktop::_thread_monitor(void *p_ud) {
dbus_connection_read_write(portal->monitor_connection, 0);
}
usleep(50000);
OS::get_singleton()->delay_usec(50'000);
}
}