git-svn-id: svn://db.shs.com.ru/pip@114 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -129,7 +129,8 @@ bool PIThread::start(int timer_delay) {
|
|||||||
pthread_attr_destroy(&attr);
|
pthread_attr_destroy(&attr);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
#else
|
#else
|
||||||
thread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)thread_function, this, 0, 0);
|
thread = (void *)_beginthreadex(0, 0, thread_function, this, 0, 0);
|
||||||
|
// thread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)thread_function, this, 0, 0);
|
||||||
if (thread != 0) {
|
if (thread != 0) {
|
||||||
#endif
|
#endif
|
||||||
setPriority(priority_);
|
setPriority(priority_);
|
||||||
@@ -156,7 +157,9 @@ bool PIThread::startOnce() {
|
|||||||
pthread_attr_destroy(&attr);
|
pthread_attr_destroy(&attr);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
#else
|
#else
|
||||||
thread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)thread_function_once, this, 0, 0);
|
uint _id = 0;
|
||||||
|
thread = (void *)_beginthreadex(0, 0, thread_function_once, this, 0, 0);
|
||||||
|
// thread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)thread_function_once, this, 0, 0);
|
||||||
if (thread != 0) {
|
if (thread != 0) {
|
||||||
#endif
|
#endif
|
||||||
setPriority(priority_);
|
setPriority(priority_);
|
||||||
@@ -191,7 +194,7 @@ void PIThread::terminate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void * PIThread::thread_function(void * t) {
|
uint __stdcall PIThread::thread_function(void * t) {
|
||||||
#ifndef WINDOWS
|
#ifndef WINDOWS
|
||||||
# ifndef ANDROID
|
# ifndef ANDROID
|
||||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0);
|
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0);
|
||||||
@@ -237,13 +240,14 @@ void * PIThread::thread_function(void * t) {
|
|||||||
#ifndef WINDOWS
|
#ifndef WINDOWS
|
||||||
pthread_exit(0);
|
pthread_exit(0);
|
||||||
#else
|
#else
|
||||||
ExitThread(0);
|
_endthreadex(0);
|
||||||
|
// ExitThread(0);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void * PIThread::thread_function_once(void * t) {
|
uint __stdcall PIThread::thread_function_once(void * t) {
|
||||||
#ifndef WINDOWS
|
#ifndef WINDOWS
|
||||||
# ifndef ANDROID
|
# ifndef ANDROID
|
||||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0);
|
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0);
|
||||||
@@ -271,7 +275,8 @@ void * PIThread::thread_function_once(void * t) {
|
|||||||
#ifndef WINDOWS
|
#ifndef WINDOWS
|
||||||
pthread_exit(0);
|
pthread_exit(0);
|
||||||
#else
|
#else
|
||||||
ExitThread(0);
|
_endthreadex(0);
|
||||||
|
// ExitThread(0);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -174,8 +174,8 @@ public:
|
|||||||
//! \}
|
//! \}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void * thread_function(void * t);
|
static uint __stdcall thread_function(void * t);
|
||||||
static void * thread_function_once(void * t);
|
static uint __stdcall thread_function_once(void * t);
|
||||||
static int priority2System(PIThread::Priority p);
|
static int priority2System(PIThread::Priority p);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user