| 1945 | |
| 1946 | |
| 1947 | void sleep_ms(int milliseconds) { // cross-platform sleep function |
| 1948 | #if defined(_WIN64) && !defined(__CYGWIN__) |
| 1949 | Sleep(milliseconds); |
| 1950 | #elif _POSIX_C_SOURCE >= 199309L |
| 1951 | struct timespec ts; |
| 1952 | ts.tv_sec = milliseconds / 1000; |
| 1953 | ts.tv_nsec = (milliseconds % 1000) * 1000000; |
| 1954 | nanosleep(&ts, NULL); |
| 1955 | #else |
| 1956 | if (milliseconds >= 1000) |
| 1957 | sleep(milliseconds / 1000); |
| 1958 | usleep((milliseconds % 1000) * 1000); |
| 1959 | #endif |
| 1960 | } |
| 1961 | |
| 1962 | |
| 1963 | void *thread_bPload(void *vargp) { |
nothing calls this directly
no outgoing calls
no test coverage detected