MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / lock_impl

Function lock_impl

extern/boost/boost/thread/lock_algorithms.hpp:144–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142
143 template <typename MutexType1, typename MutexType2>
144 void lock_impl(MutexType1& m1, MutexType2& m2, is_mutex_type_wrapper<true> )
145 {
146 unsigned const lock_count = 2;
147 unsigned lock_first = 0;
148 for (;;)
149 {
150 switch (lock_first)
151 {
152 case 0:
153 lock_first = detail::lock_helper(m1, m2);
154 if (!lock_first) return;
155 break;
156 case 1:
157 lock_first = detail::lock_helper(m2, m1);
158 if (!lock_first) return;
159 lock_first = (lock_first + 1) % lock_count;
160 break;
161 }
162 }
163 }
164
165 template <typename Iterator>
166 void lock_impl(Iterator begin, Iterator end, is_mutex_type_wrapper<false> );

Callers 1

lockFunction · 0.85

Calls 5

lock_helperFunction · 0.85
try_lockFunction · 0.70
lockMethod · 0.45
releaseMethod · 0.45
try_lockMethod · 0.45

Tested by

no test coverage detected