Util Timer with OS specific priority (#1348)

* Util Timer with OS specific priority

* default argument for sched policy
This commit is contained in:
Tomoyuki Harada 2017-10-08 02:49:25 +09:00 committed by Aleksandar Fabijanic
parent cf0343534a
commit 71a9a57802
2 changed files with 11 additions and 0 deletions

View File

@ -52,6 +52,10 @@ public:
/// Creates the Timer, using a timer thread with
/// the given priority.
explicit Timer(int prio, int policy = Poco::Thread::POLICY_DEFAULT);
/// Creates the Timer, using a timer thread with
/// the given OS specific priority.
~Timer();
/// Destroys the Timer, cancelling all pending tasks.

View File

@ -228,6 +228,13 @@ Timer::Timer(Poco::Thread::Priority priority)
}
Timer::Timer(int prio, int policy)
{
_thread.setOSPriority(prio, policy);
_thread.start(*this);
}
Timer::~Timer()
{
try