aboutsummaryrefslogtreecommitdiff
path: root/src/lua/thread/Thread.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-08-14 16:14:32 +0800
committerchai <chaifix@163.com>2018-08-14 16:14:32 +0800
commit57efa331c7ddc247c9b14dc19d4d98afbeb4e3b4 (patch)
tree1ebba4cd5b97a771d2f35e708ceda7193b904516 /src/lua/thread/Thread.h
parent0d26ed3a45f53fdbd7731b5f2a4d88edef201e44 (diff)
*update
Diffstat (limited to 'src/lua/thread/Thread.h')
-rw-r--r--src/lua/thread/Thread.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lua/thread/Thread.h b/src/lua/thread/Thread.h
index 63f7524..6969fd8 100644
--- a/src/lua/thread/Thread.h
+++ b/src/lua/thread/Thread.h
@@ -12,17 +12,18 @@ namespace thread
{
public:
typedef jin::thread::Thread::Variant Variant;
+ typedef jin::thread::Thread::ThreadRunner ThreadRunner;
- Thread(std::string _name, std::string _code, jin::thread::Thread::ThreadRunner runner)
+ Thread(std::string _name, std::string _code, ThreadRunner runner)
: name(_name)
, code(_code)
{
thread = new jin::thread::Thread(_name, runner);
}
- bool start()
+ bool start(void* p)
{
- return thread->start();
+ return thread->start(p);
}
void wait()
@@ -75,7 +76,10 @@ namespace thread
thread->unlock();
}
- static void threadRunner(jin::thread::Thread* t);
+ static void threadRunner(Thread* t);
+
+ const std::string name;
+ const std::string code;
private:
~Thread()
@@ -85,8 +89,6 @@ namespace thread
jin::thread::Thread* thread;
- const std::string name;
- const std::string code;
};
} // thread