mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 18:42:41 +01:00
Add setaffinity method to thread implementation and interface class
This commit is contained in:
@@ -135,6 +135,11 @@ public:
|
||||
/// Typically, the real stack size is rounded up to the nearest
|
||||
/// page size multiple.
|
||||
|
||||
void setAffinity(unsigned int cpu);
|
||||
/// Limit specified thread to run only on the processors "cpu"
|
||||
/// cpu - processor (core) number
|
||||
/// Method would Throw SystemException if affinity did not setted
|
||||
|
||||
int getStackSize() const;
|
||||
/// Returns the thread's stack size in bytes.
|
||||
/// If the default stack size is used, 0 is returned.
|
||||
@@ -350,6 +355,9 @@ inline void Thread::setStackSize(int size)
|
||||
setStackSizeImpl(size);
|
||||
}
|
||||
|
||||
inline void Thread::setAffinity(unsigned int cpu) {
|
||||
setAffinityImpl(cpu);
|
||||
}
|
||||
|
||||
inline int Thread::getStackSize() const
|
||||
{
|
||||
|
||||
@@ -74,6 +74,7 @@ public:
|
||||
static int getMaxOSPriorityImpl(int policy);
|
||||
void setStackSizeImpl(int size);
|
||||
int getStackSizeImpl() const;
|
||||
void setAffinityImpl(unsigned int cpu);
|
||||
void startImpl(SharedPtr<Runnable> pTarget);
|
||||
void joinImpl();
|
||||
bool joinImpl(long milliseconds);
|
||||
|
||||
@@ -80,6 +80,7 @@ public:
|
||||
static int getMaxOSPriorityImpl(int policy);
|
||||
void setStackSizeImpl(int size);
|
||||
int getStackSizeImpl() const;
|
||||
void setAffinityImpl(unsigned int cpu);
|
||||
void startImpl(Runnable& target);
|
||||
void startImpl(Callable target, void* pData = 0);
|
||||
|
||||
@@ -139,6 +140,11 @@ inline int ThreadImpl::getOSPriorityImpl() const
|
||||
return _pData->osPrio;
|
||||
}
|
||||
|
||||
inline void ThreadImpl::setAffinityImpl(unsigned int cpu)
|
||||
{
|
||||
// TODO : create implementation
|
||||
(void)cpu;
|
||||
}
|
||||
|
||||
inline bool ThreadImpl::isRunningImpl() const
|
||||
{
|
||||
|
||||
@@ -66,6 +66,7 @@ public:
|
||||
static int getMinOSPriorityImpl(int policy);
|
||||
static int getMaxOSPriorityImpl(int policy);
|
||||
void setStackSizeImpl(int size);
|
||||
void setAffinityImpl(unsigned int cpu);
|
||||
int getStackSizeImpl() const;
|
||||
void startImpl(SharedPtr<Runnable> pTarget);
|
||||
void joinImpl();
|
||||
|
||||
@@ -67,6 +67,7 @@ public:
|
||||
static int getMaxOSPriorityImpl(int policy);
|
||||
void setStackSizeImpl(int size);
|
||||
int getStackSizeImpl() const;
|
||||
void setAffinityImpl(unsigned int cpu);
|
||||
void startImpl(SharedPtr<Runnable> pTarget);
|
||||
void joinImpl();
|
||||
bool joinImpl(long milliseconds);
|
||||
@@ -144,6 +145,11 @@ inline int ThreadImpl::getMaxOSPriorityImpl(int /* policy */)
|
||||
return PRIO_HIGHEST_IMPL;
|
||||
}
|
||||
|
||||
inline void ThreadImpl::setAffinityImpl(unsigned int cpu)
|
||||
{
|
||||
// TODO : create implementation
|
||||
(void)cpu;
|
||||
}
|
||||
|
||||
inline void ThreadImpl::sleepImpl(long milliseconds)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user