701 Remove deadlock in config notification (#1040)#1174
701 Remove deadlock in config notification (#1040)#1174jeffdiclemente merged 2 commits intoCppMicroServices:c++14-compliantfrom
Conversation
* added test to verify that update call from inside modified no longer causes deadlock * memory leaks... no idea why they are happening but 99% sure this is a false positive * fix false leak * respond to jeff comments * respond to conor 's comment --------- Co-authored-by: Toby Cormack <tcormack@mathworks.com>
| { | ||
| threadpool->join(); | ||
| } | ||
| catch (...) |
There was a problem hiding this comment.
warning: empty catch statements hide issues; to handle exceptions appropriately, consider re-throwing, handling, or avoiding catch altogether [bugprone-empty-catch]
catch (...)
^| } | ||
| } | ||
| } | ||
| catch (...) |
There was a problem hiding this comment.
warning: empty catch statements hide issues; to handle exceptions appropriately, consider re-throwing, handling, or avoiding catch altogether [bugprone-empty-catch]
catch (...)
^| } | ||
|
|
||
| void | ||
| AsyncWorkServiceThreadPool::post(std::packaged_task<void()>&& task) |
There was a problem hiding this comment.
warning: rvalue reference parameter 'task' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved]
AsyncWorkServiceThreadPool::post(std::packaged_task<void()>&& task)
^| */ | ||
| bool isBundleLoadedInThisProcess(std::string bundleName); | ||
|
|
||
| class AsyncWorkServiceThreadPool : public cppmicroservices::async::AsyncWorkService |
There was a problem hiding this comment.
warning: class 'AsyncWorkServiceThreadPool' defines a destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions]
class AsyncWorkServiceThreadPool : public cppmicroservices::async::AsyncWorkService
^| @@ -34,10 +34,7 @@ | |||
| #include "Mocks.hpp" | |||
| #include "TestFixture.hpp" | |||
| #include "TestInterfaces/Interfaces.hpp" | |||
There was a problem hiding this comment.
warning: 'TestInterfaces/Interfaces.hpp' file not found [clang-diagnostic-error]
#include "TestInterfaces/Interfaces.hpp"
^| ASSERT_FALSE(GetInstance<test::CAInterface>()) | ||
| << "Factory component should not be registered even with config matching exactly (with no ~)"; | ||
|
|
||
| auto uniqueVal1 = 6; |
There was a problem hiding this comment.
warning: 6 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]
auto uniqueVal1 = 6;
^| namespace sample | ||
| { | ||
|
|
||
| ServiceComponentCA10::ServiceComponentCA10( |
There was a problem hiding this comment.
warning: constructor does not initialize these fields: properties, CA [cppcoreguidelines-pro-type-member-init]
compendium/test_bundles/TestBundleDSCA10/src/ServiceImpl.hpp:27:
- std::shared_ptr<cppmicroservices::AnyMap> properties;
- std::shared_ptr<cppmicroservices::service::cm::ConfigurationAdmin> CA;
+ std::shared_ptr<cppmicroservices::AnyMap> properties{};
+ std::shared_ptr<cppmicroservices::service::cm::ConfigurationAdmin> CA{};| @@ -0,0 +1,33 @@ | |||
| #ifndef _SERVICE_IMPL_HPP_ | |||
| #define _SERVICE_IMPL_HPP_ | |||
There was a problem hiding this comment.
warning: declaration uses identifier 'SERVICE_IMPL_HPP', which is a reserved identifier [bugprone-reserved-identifier]
| #define _SERVICE_IMPL_HPP_ | |
| #define SERVICE_IMPL_HPP_ |
| #ifndef _SERVICE_IMPL_HPP_ | ||
| #define _SERVICE_IMPL_HPP_ | ||
|
|
||
| #include "TestInterfaces/Interfaces.hpp" |
There was a problem hiding this comment.
warning: 'TestInterfaces/Interfaces.hpp' file not found [clang-diagnostic-error]
#include "TestInterfaces/Interfaces.hpp"
^|
|
||
| namespace sample | ||
| { | ||
| class ServiceComponentCA10 : public test::CAInterface |
There was a problem hiding this comment.
warning: class 'ServiceComponentCA10' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions]
class ServiceComponentCA10 : public test::CAInterface
^73bba2f
into
CppMicroServices:c++14-compliant
cherry-pick of commit 2e4eca4 (PR #1040)
see discussion #701