Skip to content

Commit

Permalink
[4.4.4] [ioc] fixed Inject get method
Browse files Browse the repository at this point in the history
  • Loading branch information
igorkorsukov committed Nov 27, 2024
1 parent c55e4da commit b790329
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SOFTWARE.
*/
#include "ioc.h"

std::mutex kors::modularity::StaticMutex::mutex;
std::recursive_mutex kors::modularity::StaticMutex::mutex;

static std::map<kors::modularity::IoCID, kors::modularity::ModulesIoC*> s_map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void removeIoC(const ContextPtr& ctx = nullptr);

struct StaticMutex
{
static std::mutex mutex;
static std::recursive_mutex mutex;
};

template<class I>
Expand Down Expand Up @@ -74,7 +74,7 @@ class Inject
const std::shared_ptr<I>& get() const
{
if (!m_i) {
const std::lock_guard<std::mutex> lock(StaticMutex::mutex);
const std::lock_guard<std::recursive_mutex> lock(StaticMutex::mutex);
if (!m_i) {
static std::string_view module = "";
m_i = _ioc(iocContext())->template resolve<I>(module);
Expand Down

0 comments on commit b790329

Please sign in to comment.