X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/bfb8d7685e998fbcafcb5315b3c50a77760b7e48..53c1823aaef2eb8d547a8eed8cfe12fe7204ca79:/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp diff --git a/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp b/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp index b82293d4..837c8649 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp +++ b/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp @@ -1,5 +1,3 @@ -#include // TODO: usleep - #include #include @@ -140,7 +138,10 @@ int RPC_CONFIG::Stop() { running = false; for (int i = 0; i < 5 && !stopped; ++i) - usleep(200000); + { + struct timespec ts = {0, 200000000}; + nanosleep(&ts, NULL); + } //rpcServer->terminate(); if (!stopped) { @@ -150,7 +151,10 @@ if (!stopped) printfd(__FILE__, "Failed to kill thread\n"); } for (int i = 0; i < 25 && !stopped; ++i) - usleep(200000); + { + struct timespec ts = {0, 200000000}; + nanosleep(&ts, NULL); + } if (!stopped) { printfd(__FILE__, "Failed to stop RPC thread\n");