linux errors

This commit is contained in:
2026-05-15 16:07:16 +02:00
parent 5e520d57f6
commit 644695c018
5 changed files with 19 additions and 5 deletions

View File

@@ -254,7 +254,7 @@ static bool Autolykos2_HashCore(
DWORD ms = (DWORD)((autolykos2_sleepBetweenHashOperationsMicroseconds + 999) / 1000);
Sleep(ms);
#else
usleep((useconds_t)autolykos2_sleepBetweenHashOperationsMicroseconds);
sleep_for_microseconds(autolykos2_sleepBetweenHashOperationsMicroseconds);
#endif
}

View File

@@ -830,7 +830,7 @@ int main(int argc, char* argv[]) {
// Poll for completions or timeouts
if (inFlight == 0) {
// nothing in flight; small sleep to avoid busy-loop
usleep(100 * 1000);
sleep_for_milliseconds(100);
continue;
}
@@ -945,7 +945,7 @@ int main(int argc, char* argv[]) {
// retry with exponential backoff
retryCount[i]++;
uint64_t backoff = SYNC_BACKOFF_BASE_MS * (1ULL << (retryCount[i] - 1));
usleep((useconds_t)(backoff * 1000ULL));
sleep_for_milliseconds(backoff);
uint64_t req = requestedHeights[i];
if (Node_SendPacket(node, peerConn, PACKET_TYPE_FETCH_BLOCK, &req, sizeof(req)) != 0) {
@@ -964,7 +964,7 @@ int main(int argc, char* argv[]) {
if (!progressed) {
// small sleep to avoid spinning
usleep(50 * 1000);
sleep_for_milliseconds(50);
}
}

View File

@@ -40,7 +40,7 @@ static void* Node_MaintenanceThread(void* arg) {
BalanceSheet_SaveToFile(chainDataDir);
}
}
usleep((useconds_t)(n->maintenanceIntervalMs * 1000));
sleep_for_milliseconds((uint64_t)n->maintenanceIntervalMs);
}
return NULL;
}