fix: replace usleep with nanosleep for POSIX compliance
Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
3
engine.c
3
engine.c
@@ -370,7 +370,8 @@ void* save_load_thread_func(void *arg) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// No requests, sleep a bit to avoid busy-waiting
|
// 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user