38 namespace rp{
namespace hal{
44 newborn._handle = (_word_size_t)(
45 _beginthreadex(NULL, 0, (
unsigned int (_stdcall * )(
void * ))proc,
53 if (TerminateThread(
reinterpret_cast<HANDLE
>(this->
_handle), -1))
55 CloseHandle(
reinterpret_cast<HANDLE
>(this->
_handle));
68 int win_priority = THREAD_PRIORITY_NORMAL;
72 win_priority = THREAD_PRIORITY_TIME_CRITICAL;
75 win_priority = THREAD_PRIORITY_HIGHEST;
78 win_priority = THREAD_PRIORITY_NORMAL;
81 win_priority = THREAD_PRIORITY_LOWEST;
84 win_priority = THREAD_PRIORITY_IDLE;
88 if (SetThreadPriority(
reinterpret_cast<HANDLE
>(this->
_handle), win_priority))
98 int win_priority = ::GetThreadPriority(
reinterpret_cast<HANDLE
>(this->
_handle));
100 if (win_priority == THREAD_PRIORITY_ERROR_RETURN)
105 if (win_priority >= THREAD_PRIORITY_TIME_CRITICAL )
109 else if (win_priority<THREAD_PRIORITY_TIME_CRITICAL && win_priority>=THREAD_PRIORITY_ABOVE_NORMAL)
113 else if (win_priority<THREAD_PRIORITY_ABOVE_NORMAL && win_priority>THREAD_PRIORITY_BELOW_NORMAL)
116 }
else if (win_priority<=THREAD_PRIORITY_BELOW_NORMAL && win_priority>THREAD_PRIORITY_IDLE)
119 }
else if (win_priority<=THREAD_PRIORITY_IDLE)
129 switch ( WaitForSingleObject(
reinterpret_cast<HANDLE
>(this->
_handle), timeout))
132 CloseHandle(
reinterpret_cast<HANDLE
>(this->
_handle));