diff options
author | Constantin Shalnev <c.shalnev@corp.mail.ru> | 2015-08-05 17:47:33 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:59:19 +0300 |
commit | ab22f4cfaed6acb8e1578e92501fcc36e477b361 (patch) | |
tree | 3d73de2d1cb9788a2c32faa6fe45e2e06ac89f1b /base | |
parent | 383627e23c4eb5178513376e48113d6d6e9a048f (diff) |
Fixed notes
Diffstat (limited to 'base')
-rw-r--r-- | base/base_tests/threads_test.cpp | 3 | ||||
-rw-r--r-- | base/thread.cpp | 4 | ||||
-rw-r--r-- | base/thread.hpp | 10 |
3 files changed, 13 insertions, 4 deletions
diff --git a/base/base_tests/threads_test.cpp b/base/base_tests/threads_test.cpp index 6a70938b63..5f2af4bf29 100644 --- a/base/base_tests/threads_test.cpp +++ b/base/base_tests/threads_test.cpp @@ -61,7 +61,10 @@ UNIT_TEST(Simple_Threads) class SomeClass { + DISALLOW_COPY(SomeClass); + public: + SomeClass() {} void Increment(int * a, int b) { *a = *a + b; diff --git a/base/thread.cpp b/base/thread.cpp index 7ca97a895f..dc6a710b22 100644 --- a/base/thread.cpp +++ b/base/thread.cpp @@ -32,6 +32,10 @@ void RunRoutine(shared_ptr<IRoutine> routine) ///////////////////////////////////////////////////////////////////// // Thread wrapper implementation +Thread::Thread() +{ +} + Thread::~Thread() { // @todo (ygorshenin@): in general, it's not a good practice to diff --git a/base/thread.hpp b/base/thread.hpp index 2ec7b8b835..ab4b598064 100644 --- a/base/thread.hpp +++ b/base/thread.hpp @@ -40,7 +40,10 @@ class Thread thread m_thread; shared_ptr<IRoutine> m_routine; + DISALLOW_COPY(Thread); + public: + Thread(); ~Thread(); /// Run thread immediately. @@ -96,7 +99,7 @@ typedef thread::id ThreadID; ThreadID GetCurrentThreadID(); -/// A wrapper around a std thread which executes callable object in android envorinment +/// A wrapper around a std thread which executes callable object in thread which is attached to JVM /// Class has the same interface as std::thread class SimpleThread { @@ -120,9 +123,6 @@ public: return *this; } - SimpleThread(const SimpleThread &) = delete; - SimpleThread & operator= (const SimpleThread &) = delete; - void detach() { m_thread.detach(); } id get_id() const noexcept { return m_thread.get_id(); } void join() { m_thread.join(); } @@ -133,6 +133,8 @@ public: private: static void ThreadFunc(function<void()> fn); + DISALLOW_COPY(SimpleThread); + thread m_thread; }; } // namespace threads |