Mercurial > hg > orthanc
changeset 2077:14ce887a9182
NaCl
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 31 Aug 2016 17:35:38 +0200 |
parents | ec2ad6ac741e |
children | 93afa6134ab3 acb4cd4af771 |
files | Core/Toolbox.cpp Core/Toolbox.h |
diffstat | 2 files changed, 14 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/Core/Toolbox.cpp Wed Aug 17 14:43:57 2016 +0200 +++ b/Core/Toolbox.cpp Wed Aug 31 17:35:38 2016 +0200 @@ -111,6 +111,18 @@ namespace Orthanc { + void Toolbox::USleep(uint64_t microSeconds) + { +#if defined(_WIN32) + ::Sleep(static_cast<DWORD>(microSeconds / static_cast<uint64_t>(1000))); +#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__) || defined(__native_client__) + usleep(microSeconds); +#else +#error Support your platform here +#endif + } + + #if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1 static bool finish_; static ServerBarrierEvent barrierEvent_; @@ -135,18 +147,6 @@ #endif - void Toolbox::USleep(uint64_t microSeconds) - { -#if defined(_WIN32) - ::Sleep(static_cast<DWORD>(microSeconds / static_cast<uint64_t>(1000))); -#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__) - usleep(microSeconds); -#else -#error Support your platform here -#endif - } - - static ServerBarrierEvent ServerBarrierInternal(const bool* stopFlag) { #if defined(_WIN32)
--- a/Core/Toolbox.h Wed Aug 17 14:43:57 2016 +0200 +++ b/Core/Toolbox.h Wed Aug 31 17:35:38 2016 +0200 @@ -49,6 +49,8 @@ namespace Toolbox { + void USleep(uint64_t microSeconds); + #if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1 ServerBarrierEvent ServerBarrier(const bool& stopFlag); @@ -88,10 +90,6 @@ #endif #if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1 - void USleep(uint64_t microSeconds); -#endif - -#if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1 void RemoveFile(const std::string& path); #endif