diff --git a/qse/include/qse/si/Thread.hpp b/qse/include/qse/si/Thread.hpp index 61942850..ecb49f53 100644 --- a/qse/include/qse/si/Thread.hpp +++ b/qse/include/qse/si/Thread.hpp @@ -28,6 +28,7 @@ #define _QSE_SI_THREAD_CLASS_ #include +#include #include #include @@ -88,6 +89,17 @@ public: int blockAllSignals () QSE_CPP_NOEXCEPT { return qse_thr_blockallsigs(&this->thr); } int unblockAllSignals () QSE_CPP_NOEXCEPT { return qse_thr_unblockallsigs(&this->thr); } + void sleep (const qse_ntime_t* duration) QSE_CPP_NOEXCEPT + { + qse_sleep (duration); + } + + void sleep (unsigned int seconds) QSE_CPP_NOEXCEPT + { + static qse_ntime_t duration = { seconds, 0 }; + qse_sleep (&duration); + } + protected: qse_thr_t thr; void* __exctx; diff --git a/qse/lib/si/App.cpp b/qse/lib/si/App.cpp index ac0d64a1..26d13d6b 100644 --- a/qse/lib/si/App.cpp +++ b/qse/lib/si/App.cpp @@ -203,7 +203,7 @@ void App::sleep (const qse_ntime_t* duration) QSE_CPP_NOEXCEPT void App::sleep (unsigned int seconds) QSE_CPP_NOEXCEPT { - static qse_ntime_t duration = { seconds, 0 }; + qse_ntime_t duration = { seconds, 0 }; qse_sleep (&duration); }