30.11.2013 - New PICollection namespace, Android support, my own PIVector implementation
This commit is contained in:
12
pithread.cpp
12
pithread.cpp
@@ -108,7 +108,11 @@ PIThread::~PIThread() {
|
||||
piMonitor.threads--;
|
||||
if (!running || thread == 0) return;
|
||||
#ifndef WINDOWS
|
||||
# ifdef ANDROID
|
||||
pthread_kill(thread, SIGSTOP);
|
||||
# else
|
||||
pthread_cancel(thread);
|
||||
# endif
|
||||
#else
|
||||
TerminateThread(thread, 0);
|
||||
CloseHandle(thread);
|
||||
@@ -169,7 +173,11 @@ void PIThread::terminate() {
|
||||
if (thread == 0) return;
|
||||
running = false;
|
||||
#ifndef WINDOWS
|
||||
# ifdef ANDROID
|
||||
pthread_kill(thread, SIGSTOP);
|
||||
# else
|
||||
pthread_cancel(thread);
|
||||
# endif
|
||||
#else
|
||||
TerminateThread(thread, 0);
|
||||
CloseHandle(thread);
|
||||
@@ -181,8 +189,10 @@ void PIThread::terminate() {
|
||||
|
||||
void * PIThread::thread_function(void * t) {
|
||||
#ifndef WINDOWS
|
||||
# ifndef ANDROID
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0);
|
||||
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0);
|
||||
# endif
|
||||
#else
|
||||
__PISetTimerResolution();
|
||||
#endif
|
||||
@@ -212,8 +222,10 @@ void * PIThread::thread_function(void * t) {
|
||||
|
||||
void * PIThread::thread_function_once(void * t) {
|
||||
#ifndef WINDOWS
|
||||
# ifndef ANDROID
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0);
|
||||
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0);
|
||||
# endif
|
||||
#else
|
||||
__PISetTimerResolution();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user