added Thread::sleep() wrappers
This commit is contained in:
parent
17dcf4feb5
commit
c5c9c47e86
@ -28,6 +28,7 @@
|
|||||||
#define _QSE_SI_THREAD_CLASS_
|
#define _QSE_SI_THREAD_CLASS_
|
||||||
|
|
||||||
#include <qse/si/thr.h>
|
#include <qse/si/thr.h>
|
||||||
|
#include <qse/si/os.h>
|
||||||
#include <qse/Uncopyable.hpp>
|
#include <qse/Uncopyable.hpp>
|
||||||
#include <qse/cmn/Mmged.hpp>
|
#include <qse/cmn/Mmged.hpp>
|
||||||
|
|
||||||
@ -88,6 +89,17 @@ public:
|
|||||||
int blockAllSignals () QSE_CPP_NOEXCEPT { return qse_thr_blockallsigs(&this->thr); }
|
int blockAllSignals () QSE_CPP_NOEXCEPT { return qse_thr_blockallsigs(&this->thr); }
|
||||||
int unblockAllSignals () QSE_CPP_NOEXCEPT { return qse_thr_unblockallsigs(&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:
|
protected:
|
||||||
qse_thr_t thr;
|
qse_thr_t thr;
|
||||||
void* __exctx;
|
void* __exctx;
|
||||||
|
@ -203,7 +203,7 @@ void App::sleep (const qse_ntime_t* duration) QSE_CPP_NOEXCEPT
|
|||||||
|
|
||||||
void App::sleep (unsigned int seconds) 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);
|
qse_sleep (&duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user