git-svn-id: svn://db.shs.com.ru/pip@597 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2018-02-12 12:20:15 +00:00
parent da48575caa
commit 6c51e8edf3
43 changed files with 204 additions and 164 deletions

View File

@@ -223,8 +223,11 @@ bool PIThread::start(int timer_delay) {
# endif
#else
if (PRIVATE->thread != 0) CloseHandle(PRIVATE->thread);
# ifdef CC_GCC
PRIVATE->thread = (void *)_beginthreadex(0, 0, thread_function, this, 0, 0);
// PRIVATE->thread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)thread_function, this, 0, 0);
# else
PRIVATE->thread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)thread_function, this, 0, 0);
# endif
if (PRIVATE->thread != 0) {
#endif
setPriority(priority_);
@@ -259,8 +262,11 @@ bool PIThread::startOnce() {
# endif
#else
if (PRIVATE->thread != 0) CloseHandle(PRIVATE->thread);
# ifdef CC_GCC
PRIVATE->thread = (void *)_beginthreadex(0, 0, thread_function_once, this, 0, 0);
// thread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)thread_function_once, this, 0, 0);
# else
PRIVATE->thread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)thread_function_once, this, 0, 0);
# endif
if (PRIVATE->thread != 0) {
#endif
setPriority(priority_);
@@ -447,8 +453,11 @@ void PIThread::__thread_func__(void * t) {
#ifndef WINDOWS
pthread_exit(0);
#else
# ifdef CC_GCC
_endthreadex(0);
//ExitThread(0);
# else
ExitThread(0);
# endif
#endif
}
@@ -493,7 +502,10 @@ void PIThread::__thread_func_once__(void * t) {
#ifndef WINDOWS
pthread_exit(0);
#else
# ifdef CC_GCC
_endthreadex(0);
//ExitThread(0);
# else
ExitThread(0);
# endif
#endif
}