comparison Plugins/Engine/OrthancPlugins.cpp @ 1553:7c4b487b3b4a

ensure mutual exclusion in InvokeService
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 20 Aug 2015 10:32:43 +0200
parents 33d34bc4ac15
children 89ab71a68fcf
comparison
equal deleted inserted replaced
1552:729d69336919 1553:7c4b487b3b4a
127 bool hasStorageArea_; 127 bool hasStorageArea_;
128 _OrthancPluginRegisterStorageArea storageArea_; 128 _OrthancPluginRegisterStorageArea storageArea_;
129 boost::recursive_mutex restCallbackMutex_; 129 boost::recursive_mutex restCallbackMutex_;
130 boost::recursive_mutex storedCallbackMutex_; 130 boost::recursive_mutex storedCallbackMutex_;
131 boost::recursive_mutex changeCallbackMutex_; 131 boost::recursive_mutex changeCallbackMutex_;
132 boost::recursive_mutex invokeServiceMutex_;
132 Properties properties_; 133 Properties properties_;
133 int argc_; 134 int argc_;
134 char** argv_; 135 char** argv_;
135 std::auto_ptr<OrthancPluginDatabase> database_; 136 std::auto_ptr<OrthancPluginDatabase> database_;
136 137
854 855
855 856
856 bool OrthancPlugins::InvokeService(_OrthancPluginService service, 857 bool OrthancPlugins::InvokeService(_OrthancPluginService service,
857 const void* parameters) 858 const void* parameters)
858 { 859 {
860 boost::recursive_mutex::scoped_lock lock(pimpl_->invokeServiceMutex_);
861
859 switch (service) 862 switch (service)
860 { 863 {
861 case _OrthancPluginService_GetOrthancPath: 864 case _OrthancPluginService_GetOrthancPath:
862 { 865 {
863 std::string s = Toolbox::GetPathToExecutable(); 866 std::string s = Toolbox::GetPathToExecutable();