Index: src/Thread.cpp |
diff --git a/src/Thread.cpp b/src/Thread.cpp |
index 277dd386ce87c614fb6b771dff09ada8243b3476..91bfe61fdf727b428f63b9d413bc9bef130a6d39 100644 |
--- a/src/Thread.cpp |
+++ b/src/Thread.cpp |
@@ -23,14 +23,6 @@ |
using namespace AdblockPlus; |
-namespace |
-{ |
- void CallRun(Thread* thread) |
- { |
- thread->Run(); |
- } |
-} |
- |
void AdblockPlus::Sleep(const int millis) |
{ |
#ifdef WIN32 |
@@ -86,6 +78,11 @@ Lock::~Lock() |
mutex.Unlock(); |
} |
+Thread::Thread(bool deleteSelfOnFinish) |
+ : m_deleteSelfOnFinish(deleteSelfOnFinish) |
Oleksandr
2016/11/07 10:31:31
Do we have a case where we would not want to delet
sergei
2016/11/07 13:04:12
Yes, we have it already in tests, in those cases T
|
+{ |
+} |
+ |
Thread::~Thread() |
{ |
} |
@@ -107,3 +104,10 @@ void Thread::Join() |
pthread_join(nativeThread, 0); |
#endif |
} |
+ |
+void Thread::CallRun(Thread* thread) |
+{ |
+ thread->Run(); |
+ if (thread->m_deleteSelfOnFinish) |
sergei
2016/11/07 13:04:12
BTW, this code is pretty dangerous because it's ve
|
+ delete thread; |
+} |