diff options
author | Serhii Niukalov (GitHub) <36993782+SNiukalov@users.noreply.github.com> | 2020-08-21 18:47:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-21 11:47:06 -0400 |
commit | b476821b44a3bb3333a17202763daca808a44f70 (patch) | |
tree | dcc77c046b6e2bb9268fef0286e0db95bd612dac /src/components/policy/policy_regular | |
parent | 2bfbdcea6c70219c66eb422fe98bdeda559ff335 (diff) | |
download | sdl_core-b476821b44a3bb3333a17202763daca808a44f70.tar.gz |
Fix avoid race conditions (#3471)
* Introduced enums instead multiple bool flags
Update threadFunc logic
Update Start logic
Update Stop logic
Update Join logic
* Update of the affected code
* UTs update
Co-authored-by: sniukalov <sniukaov@luxoft.com>
Diffstat (limited to 'src/components/policy/policy_regular')
-rw-r--r-- | src/components/policy/policy_regular/src/cache_manager.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc index ed2bbefcd7..7c491a28a5 100644 --- a/src/components/policy/policy_regular/src/cache_manager.cc +++ b/src/components/policy/policy_regular/src/cache_manager.cc @@ -113,14 +113,14 @@ CacheManager::CacheManager() LOG4CXX_AUTO_TRACE(logger_); backuper_ = new BackgroundBackuper(this); backup_thread_ = threads::CreateThread("Backup thread", backuper_); - backup_thread_->start(); + backup_thread_->Start(); } CacheManager::~CacheManager() { LOG4CXX_AUTO_TRACE(logger_); sync_primitives::AutoLock lock(backuper_locker_); - backup_thread_->join(); - delete backup_thread_->delegate(); + backup_thread_->Stop(threads::Thread::kThreadSoftStop); + delete backup_thread_->GetDelegate(); threads::DeleteThread(backup_thread_); } |