fix: replace usleep with nanosleep for POSIX compliance

Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-02 10:27:26 +00:00
parent 9c43d5c343
commit e79ebd3301

View File

@@ -370,7 +370,8 @@ void* save_load_thread_func(void *arg) {
}
} else {
// No requests, sleep a bit to avoid busy-waiting
usleep(1000); // 1ms
struct timespec ts = { .tv_sec = 0, .tv_nsec = 1000000 }; // 1ms
nanosleep(&ts, NULL);
}
}