1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-16 12:36:43 +02:00

Replace deprecated usleep function with nanosleep

usleep was declared obsolete in POSIX.1-2001
This commit is contained in:
jfreegman
2020-11-03 12:17:48 -05:00
parent f64300d1d6
commit 42763905d7
7 changed files with 32 additions and 13 deletions

View File

@@ -123,7 +123,7 @@ DeviceError terminate_devices(void)
thread_running = false;
unlock;
usleep(20000);
sleep_thread(20000L);
if (pthread_mutex_destroy(&mutex) != 0) {
return (DeviceError) de_InternalError;
@@ -499,7 +499,7 @@ void *thread_poll(void *arg) // TODO: maybe use thread for every input source
/* Wait for unpause. */
if (paused) {
usleep(10000);
sleep_thread(10000L);
}
else {
@@ -533,7 +533,7 @@ void *thread_poll(void *arg) // TODO: maybe use thread for every input source
unlock;
}
usleep(5000);
sleep_thread(5000L);
}
}