Home
last modified time | relevance | path

Searched refs:mutex (Results 1 – 25 of 51) sorted by relevance

123

/oneTBB/include/oneapi/tbb/
H A Dmutex.h31 class mutex {
34 mutex() { in mutex() function
39 ~mutex() = default;
42 mutex(const mutex&) = delete;
43 mutex& operator=(const mutex&) = delete;
45 using scoped_lock = unique_scoped_lock<mutex>;
88 using detail::d1::mutex;
/oneTBB/examples/parallel_for/tachyon/src/
H A Dpthread.cpp127 int pthread_mutex_init(pthread_mutex_t *mutex, pthread_mutexattr_t *mutex_attr) { in pthread_mutex_init() argument
128 InitializeCriticalSection(&mutex->critsec); in pthread_mutex_init()
132 int pthread_mutex_destroy(pthread_mutex_t *mutex) { in pthread_mutex_destroy() argument
136 int pthread_mutex_lock(pthread_mutex_t *mutex) { in pthread_mutex_lock() argument
137 EnterCriticalSection(&mutex->critsec); in pthread_mutex_lock()
141 int pthread_mutex_unlock(pthread_mutex_t *mutex) { in pthread_mutex_unlock() argument
142 LeaveCriticalSection(&mutex->critsec); in pthread_mutex_unlock()
H A Dpthread_w.hpp101 extern int pthread_mutex_init(pthread_mutex_t *mutex, pthread_mutexattr_t *mutex_attr);
102 extern int pthread_mutex_destroy(pthread_mutex_t *mutex);
103 extern int pthread_mutex_lock(pthread_mutex_t *mutex);
104 extern int pthread_mutex_unlock(pthread_mutex_t *mutex);
/oneTBB/include/oneapi/tbb/detail/
H A D_mutex_common.h33 requires( Lock& lock, Mutex& mutex ) { in requires() argument
34 lock.acquire(mutex); in requires()
35 { lock.try_acquire(mutex) } -> adaptive_same_as<bool>; in requires()
42 requires( Lock& lock, Mutex& mutex ) { in requires() argument
43 lock.acquire(mutex, false); in requires()
44 { lock.try_acquire(mutex, false) } -> adaptive_same_as<bool>; in requires()
/oneTBB/doc/main/reference/
H A Dcustom_mutex_chmap.rst3 The customizing mutex type for ``concurrent_hash_map``
16 oneTBB ``concurrnent_hash_map`` class uses reader-writer mutex
18 for ``concurrent_hash_map`` that allows to customize the type of the reader-writer mutex.
52 The type of the mutex passed as a template argument for ``concurrent_hash_map`` should
58 **Returns**: ``true`` if the ``scoped_lock`` object acquires the mutex as a writer, ``false`` other…
60 The behavior is undefined if the ``scoped_lock`` object does not acquire the mutex.
68 of `ReaderWriterMutex` and how to customize ``concurrent_hash_map`` to use this mutex.
87 scoped_lock(SharedMutexWrapper& mutex, bool write = true)
88 : my_mutex_ptr(&mutex), my_writer_flag(write)
101 void acquire(SharedMutexWrapper& mutex, bool write = true) {
[all …]
/oneTBB/doc/main/tbb_userguide/
H A DMutex_Flavors.rst16 thread at a time. A *scalable mutex* is one that does not do *worse*
17 than this. A mutex can do worse than serialize execution if the
21 light contention, so a non-scalable mutex may be better. When in
22 doubt, use a scalable mutex.
25 - **Fair**. Mutexes can be *fair* or *unfair*. A fair mutex lets
35 mutex either *yields* or *blocks*. Here *yields* means to
43 The following is a summary of mutex behaviors:
56 - ``mutex`` has behavior similar to the ``spin_mutex``. However,
57 the ``mutex`` *blocks* on long waits that makes it
70 - ``rw_mutex`` is similar to ``mutex``, but additionally support
[all …]
H A DMutual_Exclusion.rst9 exclusion is implemented by *mutexes* and *locks.* A mutex is an object
11 a lock on a mutex; other threads have to wait their turn.
14 The simplest mutex is ``spin_mutex``. A thread trying to acquire a lock
17 instructions. For example, the following code uses a mutex
89 Method ``acquire`` waits until it can acquire a lock on the mutex;
98 why there are not simply acquire and release methods on the mutex object
112 of the mutexes have a nested ``scoped_lock`` type, so given a mutex of
117 It is recommended that you always use a ``typedef`` for the mutex
H A DLock_Pathologies.rst25 - Each thread holds at least one lock on a mutex, and is waiting on
26 a mutex for which the *next* thread in the cycle already has a
48 if the locks are unnamed, acquire locks in order of the mutex’s
/oneTBB/src/tbb/tools_api/
H A Dittnotify_static.c367 __itt_mutex_unlock(&_N_(_ittapi_global).mutex); in ITT_VERSIONIZE()
372 __itt_mutex_unlock(&_N_(_ittapi_global).mutex); in ITT_VERSIONIZE()
409 __itt_mutex_unlock(&_N_(_ittapi_global).mutex); in ITT_VERSIONIZE()
422 __itt_mutex_unlock(&_N_(_ittapi_global).mutex); in ITT_VERSIONIZE()
491 __itt_mutex_unlock(&_N_(_ittapi_global).mutex); in ITT_VERSIONIZE()
511 __itt_mutex_unlock(&_N_(_ittapi_global).mutex); in ITT_VERSIONIZE()
606 __itt_mutex_unlock(&_N_(_ittapi_global).mutex); in ITT_VERSIONIZE()
702 __itt_mutex_unlock(&_N_(_ittapi_global).mutex); in ITT_VERSIONIZE()
796 __itt_mutex_unlock(&_N_(_ittapi_global).mutex); in ITT_VERSIONIZE()
891 __itt_mutex_unlock(&_N_(_ittapi_global).mutex); in ITT_VERSIONIZE()
[all …]
H A Dittnotify_config.h279 #define __itt_mutex_init(mutex) InitializeCriticalSection(mutex) argument
280 #define __itt_mutex_lock(mutex) EnterCriticalSection(mutex) argument
281 #define __itt_mutex_unlock(mutex) LeaveCriticalSection(mutex) argument
282 #define __itt_mutex_destroy(mutex) DeleteCriticalSection(mutex) argument
312 #define __itt_mutex_init(mutex) {\ argument
323 error_code = pthread_mutex_init(mutex, &mutex_attr); \
332 #define __itt_mutex_lock(mutex) pthread_mutex_lock(mutex) argument
333 #define __itt_mutex_unlock(mutex) pthread_mutex_unlock(mutex) argument
334 #define __itt_mutex_destroy(mutex) pthread_mutex_destroy(mutex) argument
510 mutex_t mutex; member
/oneTBB/test/conformance/
H A Dconformance_mutex.h39 typename M::scoped_lock lock(counter.mutex);
45 lock.acquire(counter.mutex);
124 M mutex; member
192 typename M::scoped_lock lock(counter.mutex, write); in TestReaderWriterLock()
198 lock.acquire(counter.mutex, write); in TestReaderWriterLock()
212 M mutex; in TestRWStateMultipleChange() local
214 typename M::scoped_lock l(mutex, /*write=*/false); in TestRWStateMultipleChange()
328 typename C::mutex_type::scoped_lock lock2(counter.mutex); in recurse_till()
333 lock2.acquire(counter.mutex); in recurse_till()
339 typename C::mutex_type::scoped_lock lock(counter.mutex); in operator()
H A Dconformance_mutex.cpp43 GeneralTest<oneapi::tbb::mutex>("Adaptive Mutex");
65 TestTryAcquire<oneapi::tbb::mutex>("Adaptive Mutex");
102 GeneralTest<TBB_MutexFromISO_Mutex<oneapi::tbb::mutex> >("ISO Adaprive Mutex");
106 TestTryAcquire<TBB_MutexFromISO_Mutex<oneapi::tbb::mutex> >("ISO Adaptive Mutex");
/oneTBB/test/tbb/
H A Dtest_mutex.h33 M mutex; member
40 typename mutex_type::scoped_lock lock(mutex); in flog_once()
46 lock.acquire(mutex); in flog_once()
56 M mutex; member
94 typename mutex_type::scoped_lock lock(mutex, write); in flog_once()
121 lock.acquire(mutex, write); in flog_once()
H A Dtest_resumable_tasks.cpp50 std::lock_guard<std::mutex> lock(m_mutex); in ~AsyncActivity()
63 std::lock_guard<std::mutex> lock(m_mutex); in submit()
73 std::unique_lock<std::mutex> lock(async->m_mutex); in asyncLoop()
86 std::mutex m_mutex;
198 std::lock_guard<std::mutex> lock(m_mutex); in ~EpochAsyncActivity()
211 std::lock_guard<std::mutex> lock(m_mutex); in submit()
221 std::unique_lock<std::mutex> lock(async->m_mutex); in asyncLoop()
237 std::mutex m_mutex;
H A Dtest_profiling.cpp40 Mutex mutex; variable
41 tbb::profiling::set_name(mutex, "mutex");
54 Mutex mutex; variable
55 tbb::profiling::set_name(mutex, L"mutex");
H A Dtest_mutex.cpp85 typename C::mutex_type::scoped_lock lock(counter.mutex); in operator ()()
154 test_with_native_threads::test<tbb::mutex>();
194 …static_assert(mutexes<tbb::spin_mutex, oneapi::tbb::mutex, tbb::speculative_spin_mutex, tbb::null_…
/oneTBB/src/tbb/
H A Dthread_data.h59 d1::mutex m_mutex{};
67 mutex::scoped_lock lock(m_mutex); in remove()
78 mutex::scoped_lock lock(m_mutex); in push_front()
84 mutex::scoped_lock lock(m_mutex); in orphan()
240 mutex::scoped_lock lock(my_context_list->m_mutex); in propagate_task_group_state()
H A Dobserver_proxy.cpp55 scoped_lock lock(mutex(), /*is_writer=*/true); in clear()
81 scoped_lock lock(mutex(), /*is_writer=*/false); in clear()
91 scoped_lock lock(mutex(), /*is_writer=*/true); in insert()
134 observer_list::scoped_lock lock(mutex(), /*is_writer=*/true); in remove_ref()
153 scoped_lock lock(mutex(), /*is_writer=*/false); in do_notify_entry_observers()
214 scoped_lock lock(mutex(), /*is_writer=*/false); in do_notify_exit_observers()
303 observer_list::scoped_lock lock(list.mutex(), /*is_writer=*/true); in observe()
H A Dco_context.h81 std::mutex my_mutex;
177 std::unique_lock<std::mutex> lock(c.my_mutex); in coroutine_thread_func()
225 std::unique_lock<std::mutex> lock(c.my_mutex); in create_coroutine()
248 std::unique_lock<std::mutex> lock(new_coroutine.my_mutex); in swap_coroutine()
257 std::unique_lock<std::mutex> lock(prev_coroutine.my_mutex); in swap_coroutine()
265 std::unique_lock<std::mutex> lock(c.my_mutex); in destroy_coroutine()
H A Dtask_stream.h122 using lane_t = queue_and_mutex <d1::task*, mutex>;
133 using lane_t = queue_and_mutex <d1::task*, mutex>;
212 mutex::scoped_lock lock; in pop_specific()
235 mutex::scoped_lock lock; in try_push()
250 mutex::scoped_lock lock; in try_pop()
H A Dconcurrent_monitor_mutex.h93 std::lock_guard<std::mutex> lock(my_init_mutex); in get_semaphore()
103 static std::mutex my_init_mutex;
/oneTBB/examples/test_all/fibonacci/
H A Dfibonacci.cpp163 M &mutex; member in SharedSerialFibBody
166 SharedSerialFibBody(M &m) : mutex(m) {} in SharedSerialFibBody()
170 typename M::scoped_lock lock(mutex); in operator ()()
182 void SharedSerialFibBody<std::mutex>::operator()( in operator ()()
185 std::lock_guard<std::mutex> lock(mutex); in operator ()()
202 M mutex; in SharedSerialFib() local
203 parallel_for(oneapi::tbb::blocked_range<int>(0, 4, 1), SharedSerialFibBody<M>(mutex)); in SharedSerialFib()
479 sum = Measure("Shared serial (mutex)\t", SharedSerialFib<std::mutex>, NumbersCount); in main()
/oneTBB/test/common/
H A Dutils_report.h145 static std::mutex mutex; in print_call_stack() local
146 std::lock_guard<std::mutex> lock(mutex); in print_call_stack()
H A Dconcurrency_tracker.h96 static std::mutex global_mutex;
146 std::lock_guard<std::mutex> lock(global_mutex);
168 std::mutex ExactConcurrencyLevel::global_mutex;
/oneTBB/python/tbb/
H A Dapi.i78 std::mutex m;
97 std::unique_lock<std::mutex> lock(b.m);
103 std::unique_lock<std::mutex> lock(b.m);

123