File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
libmamba/include/mamba/util Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -128,12 +128,8 @@ namespace mamba::util
128
128
129
129
namespace details
130
130
{
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
137
133
}
138
134
139
135
/* * Scoped locking type that would result from locking the provided mutex in the most
@@ -142,8 +138,8 @@ namespace mamba::util
142
138
template <Mutex M, bool readonly>
143
139
using lock_type = std::conditional_t <
144
140
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>()))>;
147
143
148
144
/* * Locks a mutex for the lifetime of this type's instance and provide access to an associated
149
145
value.
You can’t perform that action at this time.
0 commit comments