add test for thread affinity and fix some problems

This commit is contained in:
ale_bychuk
2015-03-07 10:55:23 +03:00
parent 888abad26c
commit 662fbc861a
5 changed files with 84 additions and 10 deletions

View File

@@ -135,11 +135,14 @@ public:
/// Typically, the real stack size is rounded up to the nearest
/// page size multiple.
void setAffinity(unsigned int cpu);
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
unsigned getAffinity() const;
/// Returns using cpu (core) number
int getStackSize() const;
/// Returns the thread's stack size in bytes.
/// If the default stack size is used, 0 is returned.
@@ -355,10 +358,16 @@ inline void Thread::setStackSize(int size)
setStackSizeImpl(size);
}
inline void Thread::setAffinity(unsigned int cpu) {
inline void Thread::setAffinity(unsigned int cpu)
{
setAffinityImpl(cpu);
}
inline unsigned Thread::getAffinity() const
{
return getAffinityImpl();
}
inline int Thread::getStackSize() const
{
return getStackSizeImpl();