78 if(m_hThread != NULL) {
119 m_hThread = (
unsigned long*)CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)
_ou_thread_proc,(
Thread*)
this,0,&tid);
120 if(m_hThread == NULL) {
131 if(m_hThread == NULL)
return;
132 WaitForSingleObject(m_hThread, INFINITE);
133 CloseHandle(m_hThread);
143 if(m_hThread == NULL) {
146 if(SetThreadPriority(m_hThread,tp) == 0) {
156 if(m_hThread == NULL) {
159 if(SuspendThread(m_hThread) < 0) {
169 if(m_hThread == NULL) {
172 if(ResumeThread(m_hThread) < 0) {
185 HANDLE h = OpenMutex(MUTEX_ALL_ACCESS,FALSE,m);
189 DWORD d = WaitForSingleObject(h,ms);
208 HANDLE h = OpenMutex(MUTEX_ALL_ACCESS,FALSE,m);
212 if(ReleaseMutex(h) == 0) {
234 m_hMutex = (
unsigned long*)CreateMutex(NULL,FALSE,nm);
235 if(m_hMutex == NULL) {
245 if(m_hMutex != NULL) {
246 CloseHandle(m_hMutex);
250 m_hMutex = (
unsigned long*)CreateMutex(NULL,FALSE,nm);
251 if(m_hMutex == NULL) {
270 if(m_hMutex != NULL) {
271 CloseHandle(m_hMutex);
void create(const char *nm)
unsigned long * getMutexHandle()
std::string getMessage() const
ThreadException(const char *m)
static const int P_BELOW_NORMAL
static const int P_HIGHEST
void release(const char *m)
bool wait(const char *m, long ms=5000)
static const int P_CRITICAL
void setName(const char *nm)
static const int P_ABOVE_NORMAL
std::string getName() const
static const int P_NORMAL
static const int P_LOWEST
unsigned int _ou_thread_proc(void *param)