diff options
author | Jacob Keeler <jacob.keeler@livioradio.com> | 2016-09-20 11:44:51 -0400 |
---|---|---|
committer | Jacob Keeler <jacob.keeler@livioradio.com> | 2016-09-20 14:37:25 -0400 |
commit | 039581419749dbdd32590804e8b14a77fcaf9636 (patch) | |
tree | ced927fc4bef4686f7373a5f45dd692bd9fc9de0 /src/components/utils/src/threads/thread_validator.cc | |
parent | 1b96b7c02d2e338b846a7314c6fa0bdaa31f7c5e (diff) | |
parent | aff7f09a4ec07becfb64dc78992580061d3342ff (diff) | |
download | sdl_core-039581419749dbdd32590804e8b14a77fcaf9636.tar.gz |
Merge branch 'master'
Diffstat (limited to 'src/components/utils/src/threads/thread_validator.cc')
-rw-r--r-- | src/components/utils/src/threads/thread_validator.cc | 44 |
1 files changed, 18 insertions, 26 deletions
diff --git a/src/components/utils/src/threads/thread_validator.cc b/src/components/utils/src/threads/thread_validator.cc index 99b812c456..4024522ae4 100644 --- a/src/components/utils/src/threads/thread_validator.cc +++ b/src/components/utils/src/threads/thread_validator.cc @@ -39,39 +39,32 @@ namespace threads { CREATE_LOGGERPTR_GLOBAL(logger_, "Utils") SingleThreadSimpleValidator::SingleThreadSimpleValidator() - : creation_thread_id_(Thread::CurrentId()) { -} + : creation_thread_id_(Thread::CurrentId()) {} -SingleThreadSimpleValidator::~SingleThreadSimpleValidator() { -} +SingleThreadSimpleValidator::~SingleThreadSimpleValidator() {} void SingleThreadSimpleValidator::AssertRunningOnCreationThread() const { PlatformThreadHandle current_id = Thread::CurrentId(); if (creation_thread_id_ != current_id) { - LOG4CXX_ERROR(logger_, "Single-threaded object created at thread " - << creation_thread_id_ - <<" is accessed from thread " - << current_id + LOG4CXX_ERROR(logger_, + "Single-threaded object created at thread " + << creation_thread_id_ << " is accessed from thread " + << current_id #ifdef BACKTRACE_SUPPORT - << "\n" - << utils::Backtrace() + << "\n" << utils::Backtrace() #endif - ); + ); } } -PlatformThreadHandle SingleThreadSimpleValidator::creation_thread_id() const -{ +PlatformThreadHandle SingleThreadSimpleValidator::creation_thread_id() const { return creation_thread_id_; } - SingleThreadValidator::SingleThreadValidator() - : owning_thread_id_(Thread::CurrentId()){ -} + : owning_thread_id_(Thread::CurrentId()) {} -SingleThreadValidator::~SingleThreadValidator() { -} +SingleThreadValidator::~SingleThreadValidator() {} void SingleThreadValidator::PassToThread(PlatformThreadHandle thread_id) const { owning_thread_id_ = thread_id; @@ -80,18 +73,17 @@ void SingleThreadValidator::PassToThread(PlatformThreadHandle thread_id) const { void SingleThreadValidator::AssertRunningOnValidThread() const { PlatformThreadHandle current_id = Thread::CurrentId(); if (owning_thread_id_ != current_id) { - LOG4CXX_ERROR(logger_, "Single-threaded object owned by thread " - << owning_thread_id_ - << " is accessed from thread " - << current_id << "\n" + LOG4CXX_ERROR(logger_, + "Single-threaded object owned by thread " + << owning_thread_id_ << " is accessed from thread " + << current_id << "\n" #ifdef BACKTRACE_SUPPORT - << utils::Backtrace() + << utils::Backtrace() #endif - ); + ); } } - -} // namespace threads +} // namespace threads // vim: set ts=2 sw=2 et: |