aboutsummaryrefslogtreecommitdiff
path: root/src/3rdParty/efsw/Thread.cpp
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2022-11-15 17:23:46 +0800
committerLi Jin <dragon-fly@qq.com>2022-11-15 17:52:09 +0800
commit94f8330613877b3582d32bd11abd83a97b4399ad (patch)
tree5359de314be1ebde17f8d1e48632a97d18f9e50f /src/3rdParty/efsw/Thread.cpp
parent60f8f00a022ac08701792b2897b72d8c99b50f52 (diff)
downloadyuescript-94f8330613877b3582d32bd11abd83a97b4399ad.tar.gz
yuescript-94f8330613877b3582d32bd11abd83a97b4399ad.tar.bz2
yuescript-94f8330613877b3582d32bd11abd83a97b4399ad.zip
adding -w option to Yuescript tool.
Diffstat (limited to 'src/3rdParty/efsw/Thread.cpp')
-rwxr-xr-xsrc/3rdParty/efsw/Thread.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/3rdParty/efsw/Thread.cpp b/src/3rdParty/efsw/Thread.cpp
new file mode 100755
index 0000000..e3f0fa0
--- /dev/null
+++ b/src/3rdParty/efsw/Thread.cpp
@@ -0,0 +1,40 @@
1#include <efsw/Thread.hpp>
2#include <efsw/platform/platformimpl.hpp>
3
4namespace efsw {
5
6Thread::Thread() : mThreadImpl( NULL ), mEntryPoint( NULL ) {}
7
8Thread::~Thread() {
9 wait();
10
11 efSAFE_DELETE( mEntryPoint );
12}
13
14void Thread::launch() {
15 wait();
16
17 mThreadImpl = new Platform::ThreadImpl( this );
18}
19
20void Thread::wait() {
21 if ( mThreadImpl ) {
22 mThreadImpl->wait();
23
24 efSAFE_DELETE( mThreadImpl );
25 }
26}
27
28void Thread::terminate() {
29 if ( mThreadImpl ) {
30 mThreadImpl->terminate();
31
32 efSAFE_DELETE( mThreadImpl );
33 }
34}
35
36void Thread::run() {
37 mEntryPoint->run();
38}
39
40} // namespace efsw