Skip to content

Commit d7a316d

Browse files
committed
removed unnecessary definition of mutex_ref
1 parent b7c3ac3 commit d7a316d

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

libmamba/include/mamba/util/synchronized_value.hpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,8 @@ namespace mamba::util
128128

129129
namespace details
130130
{
131-
template <Mutex M>
132-
M& mutex_ref()
133-
{
134-
static M m;
135-
return m;
136-
}
131+
template <typename T>
132+
T& ref_of(); // used only in non-executed contexts
137133
}
138134

139135
/** Scoped locking type that would result from locking the provided mutex in the most
@@ -142,8 +138,8 @@ namespace mamba::util
142138
template <Mutex M, bool readonly>
143139
using lock_type = std::conditional_t<
144140
readonly,
145-
decltype(lock_as_readonly(details::mutex_ref<M>())),
146-
decltype(lock_as_exclusive(details::mutex_ref<M>()))>;
141+
decltype(lock_as_readonly(details::ref_of<M>())),
142+
decltype(lock_as_exclusive(details::ref_of<M>()))>;
147143

148144
/** Locks a mutex for the lifetime of this type's instance and provide access to an associated
149145
value.

0 commit comments

Comments
 (0)