37 if ( ( a_eFlags & 1 ) == 0 )
40 TASSERT( iResult != -1,
"Couldn't resume thread" );
65 TASSERT( a_hThreadHnd != NULL,
"Thread doesn't exist" );
66 TINT iPriority = GetThreadPriority( a_hThreadHnd );
67 TASSERT( iPriority != THREAD_PRIORITY_ERROR_RETURN,
"Couldn't get thread priority" );
68 a_ePriority = iPriority;
74 TASSERT( a_hThreadHnd != NULL,
"Thread doesn't exist" );
75 BOOL bResult = SetThreadPriority( a_hThreadHnd, a_ePriority );
76 TASSERT( bResult != FALSE,
"Couldn't set priority" );
83 TASSERT( a_pThread->
m_iThreadID == GetCurrentThreadId(),
"Thread cannot be closed outside" );
86 TASSERT( bResult != FALSE,
"Couldn't close thread" );
97 EnterCriticalSection( &m_CriticalSection );
99 LeaveCriticalSection( &m_CriticalSection );
104 EnterCriticalSection( &m_CriticalSection );
105 m_Threads.PushFront( a_pThread );
106 LeaveCriticalSection( &m_CriticalSection );
111 InitializeCriticalSection( &m_CriticalSection );
116 DeleteCriticalSection( &m_CriticalSection );
#define TOSHI_NAMESPACE_START
#define TOSHI_NAMESPACE_END
unsigned long __stdcall ThreadEntry(void *userParam)
unsigned long m_iThreadID
TBOOL Create(size_t a_iStackSize, PRIORITY a_ePriority, TUINT8 a_eFlags)
static void Exit(TThread *a_pThread)
static TBOOL SetPriority(void *a_hThreadHnd, PRIORITY a_ePriority)
static TBOOL GetPriority(void *a_hThreadHnd, PRIORITY &a_ePriority)
void RemoveThread(TThread *a_pThread)
void InsertThread(TThread *a_pThread)
static TFORCEINLINE TThreadManager * GetSingletonSafe()