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

This commit is contained in:
2019-02-18 18:30:51 +00:00
parent 0af7eabf56
commit 217947cc89
16 changed files with 296 additions and 217 deletions

View File

@@ -82,12 +82,12 @@ public:
EVENT_HANDLER0(bool, start) {return start(-1);}
EVENT_HANDLER1(bool, start, int, timer_delay);
bool start(ThreadFunc func) {ret_func = func; return start(-1);}
bool start(ThreadFunc func) {return start(func, -1);}
bool start(ThreadFunc func, int timer_delay) {ret_func = func; return start(timer_delay);}
EVENT_HANDLER0(bool, startOnce);
EVENT_HANDLER1(bool, startOnce, ThreadFunc, func) {ret_func = func; return startOnce();}
EVENT_HANDLER0(void, stop) {stop(false);}
EVENT_HANDLER1(void, stop, bool, wait) {terminating = true; if (wait) waitForFinish();}
EVENT_HANDLER1(void, stop, bool, wait);
EVENT_HANDLER0(void, terminate);
//! \brief Set common data passed to external function
@@ -126,8 +126,8 @@ public:
//! \brief Returns thread ID
llong tid() const {return tid_;}
static void __thread_func__(void*);
static void __thread_func_once__(void*);
void __thread_func__();
void __thread_func_once__();
EVENT(started)
EVENT(stopped)
@@ -221,6 +221,10 @@ protected:
PIThread::Priority priority_;
ThreadFunc ret_func;
PRIVATE_DECLARATION
private:
NO_COPY_CLASS(PIThread)
};