mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-12 14:59:19 +01:00
Util Timer with OS specific priority (#1348)
* Util Timer with OS specific priority * default argument for sched policy
This commit is contained in:
parent
cf0343534a
commit
71a9a57802
@ -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.
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user