Thread OS priority

This commit is contained in:
Aleksandar Fabijanic
2008-04-15 23:25:19 +00:00
parent 8bc8552616
commit 32c8d371e9
5 changed files with 136 additions and 0 deletions

View File

@@ -110,6 +110,23 @@ public:
Priority getPriority() const;
/// Returns the thread's priority.
void setOSPriority(int prio);
/// Sets the thread's priority, using an operating system specific
/// priority value. Use getMinOSPriority() and getMaxOSPriority() to
/// obtain mininum and maximum priority values.
int getOSPriority() const;
/// Returns the thread's priority, expressed as an operating system
/// specific priority value.
static int getMinOSPriority();
/// Returns the mininum operating system-specific priority value,
/// which can be passed to setOSPriority().
static int getMaxOSPriority();
/// Returns the maximum operating system-specific priority value,
/// which can be passed to setOSPriority().
void setStackSize(std::size_t size);
/// Sets the thread's stack size in bytes.
/// Setting the stack size to 0 will use the default stack size.
@@ -231,6 +248,30 @@ inline Thread* Thread::current()
}
inline void Thread::setOSPriority(int prio)
{
setOSPriorityImpl(prio);
}
inline int Thread::getOSPriority() const
{
return getOSPriorityImpl();
}
inline int Thread::getMinOSPriority()
{
return ThreadImpl::getMinOSPriorityImpl();
}
inline int Thread::getMaxOSPriority()
{
return ThreadImpl::getMaxOSPriorityImpl();
}
inline void Thread::setStackSize(std::size_t size)
{
setStackSizeImpl(size);