git-svn-id: svn://db.shs.com.ru/pip@216 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -298,7 +298,7 @@ __PIInit_Initializer__::__PIInit_Initializer__() {
|
|||||||
|
|
||||||
__PIInit_Initializer__::~__PIInit_Initializer__() {
|
__PIInit_Initializer__::~__PIInit_Initializer__() {
|
||||||
count_--;
|
count_--;
|
||||||
if (count_ > 1) return;
|
if (count_ > 0) return;
|
||||||
//piCout << "delete PIInit";
|
//piCout << "delete PIInit";
|
||||||
if (__instance__ != 0) {
|
if (__instance__ != 0) {
|
||||||
delete __instance__;
|
delete __instance__;
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
#ifdef WINDOWS
|
#ifdef WINDOWS
|
||||||
void __PISetTimerResolution() {if (setTimerResolutionAddr == NULL) return; ULONG ret; setTimerResolutionAddr(1, TRUE, &ret);}
|
void __PISetTimerResolution() {if (setTimerResolutionAddr == NULL) return; ULONG ret; setTimerResolutionAddr(1, TRUE, &ret);}
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef MAC_OS
|
||||||
|
# include <pthread.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*! \class PIThread
|
/*! \class PIThread
|
||||||
@@ -134,7 +137,7 @@ bool PIThread::start(int timer_delay) {
|
|||||||
pthread_attr_destroy(&attr);
|
pthread_attr_destroy(&attr);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
# ifdef MAC_OS
|
# ifdef MAC_OS
|
||||||
pthread_threadid_np(thread, &tid)
|
pthread_threadid_np(thread, (__uint64_t*)&tid)
|
||||||
# else
|
# else
|
||||||
tid_ = thread;
|
tid_ = thread;
|
||||||
# endif
|
# endif
|
||||||
@@ -169,7 +172,11 @@ bool PIThread::startOnce() {
|
|||||||
//piCout << "pthread_create" << thread;
|
//piCout << "pthread_create" << thread;
|
||||||
pthread_attr_destroy(&attr);
|
pthread_attr_destroy(&attr);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
|
# ifdef MAC_OS
|
||||||
|
pthread_threadid_np(thread, (__uint64_t*)&tid)
|
||||||
|
# else
|
||||||
tid_ = thread;
|
tid_ = thread;
|
||||||
|
# endif
|
||||||
#else
|
#else
|
||||||
if (thread != 0) CloseHandle(thread);
|
if (thread != 0) CloseHandle(thread);
|
||||||
thread = (void *)_beginthreadex(0, 0, thread_function_once, this, 0, 0);
|
thread = (void *)_beginthreadex(0, 0, thread_function_once, this, 0, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user