| /oneTBB/test/tbb/ |
| H A D | test_mutex.h | 42 lock.release(); in flog_once() 45 typename mutex_type::scoped_lock lock; in flog_once() local 46 lock.acquire(mutex); in flog_once() 117 lock.release(); in flog_once() 120 typename mutex_type::scoped_lock lock; in flog_once() local 121 lock.acquire(mutex, write); in flog_once() 225 scoped_lock lock; in TestIsWriter() local 230 scoped_lock lock; in TestIsWriter() local 231 lock.acquire(rw_mutex, /*writer = */true); in TestIsWriter() 237 lock.upgrade_to_writer(); in TestIsWriter() [all …]
|
| H A D | test_scheduler_mix.cpp | 140 mMutex->lock(); in acquire() 224 void lock() { in lock() function in PtrRWMutex 437 ScopedLock lock; in destroy() local 440 lock.clear(); in destroy() 459 ScopedLock lock{ arena, true }; in shutdown() local 461 lock.clear(); in shutdown() 495 void release(ScopedLock& lock) { in release() argument 501 lock.release(); in release() 548 ArenaTable::ScopedLock lock; in do_it() local 549 auto entry = arenaTable.acquire(r, lock); in do_it() [all …]
|
| H A D | test_resumable_tasks.cpp | 50 std::lock_guard<std::mutex> lock(m_mutex); in ~AsyncActivity() local 63 std::lock_guard<std::mutex> lock(m_mutex); in submit() local 73 std::unique_lock<std::mutex> lock(async->m_mutex); in asyncLoop() local 74 async->m_condvar.wait(lock, [async] {return !async->m_tagQueue.empty(); }); in asyncLoop() 198 std::lock_guard<std::mutex> lock(m_mutex); in ~EpochAsyncActivity() local 211 std::lock_guard<std::mutex> lock(m_mutex); in submit() local 221 std::unique_lock<std::mutex> lock(async->m_mutex); in asyncLoop() local 222 async->m_condvar.wait(lock, [async] {return !async->m_tagQueue.empty(); }); in asyncLoop()
|
| /oneTBB/test/conformance/ |
| H A D | conformance_mutex.h | 41 lock.release(); 44 typename M::scoped_lock lock; 45 lock.acquire(counter.mutex); 80 lock.release(); 116 lock.release(); 194 lock.release(); in TestReaderWriterLock() 197 typename M::scoped_lock lock; in TestReaderWriterLock() 248 m.my_iso_mutex.lock(); in acquire() 299 my_mutex->my_iso_mutex.lock(); in upgrade_to_writer() 382 m.lock(); in TestNullMutex() [all …]
|
| /oneTBB/include/oneapi/tbb/detail/ |
| H A D | _mutex_common.h | 33 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() 36 lock.release(); 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() 45 { lock.upgrade_to_writer() } -> adaptive_same_as<bool>; in requires() 46 { lock.downgrade_to_reader() } -> adaptive_same_as<bool>; in requires()
|
| H A D | _flow_graph_cache_impl.h | 34 typename mutex_type::scoped_lock lock( my_mutex ); in empty() 39 typename mutex_type::scoped_lock lock( my_mutex ); in add() 44 typename mutex_type::scoped_lock lock( my_mutex ); in remove() 108 typename mutex_type::scoped_lock lock(this->my_mutex); in get_item() 166 typename mutex_type::scoped_lock lock(this->my_mutex); in try_reserve() 178 typename mutex_type::scoped_lock lock(this->my_mutex); in try_reserve()
|
| /oneTBB/doc/main/tbb_userguide/ |
| H A D | Mutual_Exclusion.rst | 11 a lock on a mutex; other threads have to wait their turn. 15 on a ``spin_mutex`` busy waits until it can acquire the lock. A 16 ``spin_mutex`` is appropriate when the lock is held for only a few 31 FreeListMutexType::scoped_lock lock(FreeListMutex); 43 FreeListMutexType::scoped_lock lock(FreeListMutex); 77 FreeListMutexType::scoped_lock lock; 78 lock.acquire(FreeListMutex); 82 lock.release(); 90 method ``release`` releases the lock. 94 to maintainers which code is protected by the lock. [all …]
|
| H A D | UpgradeDowngrade.rst | 7 It is possible to upgrade a reader lock to a writer lock, by using the 20 // Obtain a reader lock on MyVectorMutex 21 MyVectorMutexType::scoped_lock lock(MyVectorMutex,/*is_writer=*/false); 25 if( !lock.upgrade_to_writer() ) 26 // Check if key was added while lock was temporarily released 34 because ``upgrade_to_writer`` might have to temporarily release the lock 37 that is true if it successfully upgraded the lock without releasing it, 38 and false if the lock was released temporarily. Thus when 46 holding a reader lock may have been invalidated, and must be rechecked.
|
| H A D | Lock_Pathologies.rst | 18 lock, and each holds some of the locks the other threads need to 25 - Each thread holds at least one lock on a mutex, and is waiting on 27 lock. 30 - No thread is willing to give up its lock. 40 holding a single lock. 45 acquire a lock on one of each, you could always acquire the "outer 62 when the operating system interrupts a thread that is holding a lock. 64 releases the lock. Fair mutexes can make the situation even worse, 69 To minimize convoying, try to hold the lock as briefly as possible. 70 Precompute whatever you can before acquiring the lock.
|
| H A D | Reader_Writer_Mutexes.rst | 12 lock on a given mutex. 15 Requests for a reader lock are distinguished from requests for a writer 16 lock via an extra boolean parameter in the constructor for 17 ``scoped_lock``. The parameter is false to request a reader lock and 18 true to request a writer lock. It defaults to ``true`` so that when
|
| H A D | appendix_A.rst | 40 Another cost is *lock preemption.* This happens if a thread acquires a 41 lock on a resource, and its time slice runs out before it releases the 42 lock. No matter how short a time the thread intended to hold the lock, 44 turn at a time slice to come up. Any other threads waiting on the lock
|
| /oneTBB/src/tbb/ |
| H A D | thread_request_serializer.cpp | 39 mutex_type::scoped_lock lock(my_mutex); in update() local 47 mutex_type::scoped_lock lock(my_mutex); in set_active_num_workers() local 84 mutex_type::scoped_lock lock(my_mutex, /* is_write = */ false); in register_mandatory_request() local 91 enable_mandatory_concurrency(lock); in register_mandatory_request() 93 disable_mandatory_concurrency(lock); in register_mandatory_request() 99 mutex_type::scoped_lock lock(my_mutex, /* is_write = */ true); in set_active_num_workers() local 114 void thread_request_serializer_proxy::enable_mandatory_concurrency(mutex_type::scoped_lock& lock) { in enable_mandatory_concurrency() argument 115 lock.upgrade_to_writer(); in enable_mandatory_concurrency() 125 void thread_request_serializer_proxy::disable_mandatory_concurrency(mutex_type::scoped_lock& lock) { in disable_mandatory_concurrency() argument 126 lock.upgrade_to_writer(); in disable_mandatory_concurrency()
|
| H A D | threading_control.cpp | 215 global_mutex_type::scoped_lock lock(g_threading_control_mutex); in create_threading_control() local 250 lock.release(); in wait_last_reference() 261 lock.acquire(g_threading_control_mutex); in wait_last_reference() 268 global_mutex_type::scoped_lock lock(g_threading_control_mutex); in release() local 271 wait_last_reference(lock); in release() 290 global_mutex_type::scoped_lock lock(g_threading_control_mutex); in register_public_reference() local 294 lock.release(); in register_public_reference() 309 global_mutex_type::scoped_lock lock(g_threading_control_mutex); in create_client() local 341 global_mutex_type::scoped_lock lock(g_threading_control_mutex); in is_present() local 346 global_mutex_type::scoped_lock lock(g_threading_control_mutex); in register_lifetime_control() local [all …]
|
| H A D | observer_proxy.cpp | 55 scoped_lock lock(mutex(), /*is_writer=*/true); in clear() local 81 scoped_lock lock(mutex(), /*is_writer=*/false); in clear() local 91 scoped_lock lock(mutex(), /*is_writer=*/true); in insert() local 134 observer_list::scoped_lock lock(mutex(), /*is_writer=*/true); in remove_ref() local 153 scoped_lock lock(mutex(), /*is_writer=*/false); in do_notify_entry_observers() local 172 lock.release(); in do_notify_entry_observers() 214 scoped_lock lock(mutex(), /*is_writer=*/false); in do_notify_exit_observers() local 227 lock.release(); in do_notify_exit_observers() 303 observer_list::scoped_lock lock(list.mutex(), /*is_writer=*/true); in observe() local
|
| H A D | thread_data.h | 67 mutex::scoped_lock lock(m_mutex); in remove() 72 lock.release(); in remove() 78 mutex::scoped_lock lock(m_mutex); in push_front() 84 mutex::scoped_lock lock(m_mutex); in orphan() 88 lock.release(); in orphan() 240 mutex::scoped_lock lock(my_context_list->m_mutex); in propagate_task_group_state()
|
| H A D | cancellation_disseminator.h | 45 threads_list_mutex_type::scoped_lock lock(my_threads_list_mutex); in propagate_task_group_state() 64 threads_list_mutex_type::scoped_lock lock(my_threads_list_mutex); in register_thread() 69 threads_list_mutex_type::scoped_lock lock(my_threads_list_mutex); in unregister_thread()
|
| H A D | co_context.h | 177 std::unique_lock<std::mutex> lock(c.my_mutex); in coroutine_thread_func() 185 c.my_condvar.wait(lock, [&c] { return c.my_is_active == true; }); in coroutine_thread_func() 225 std::unique_lock<std::mutex> lock(c.my_mutex); in create_coroutine() 226 c.my_condvar.wait(lock, [&arg] { return arg == nullptr; }); 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() 258 …prev_coroutine.my_condvar.wait(lock, [&prev_coroutine] { return prev_coroutine.my_is_active == tru… in swap_coroutine() 265 std::unique_lock<std::mutex> lock(c.my_mutex); in destroy_coroutine()
|
| H A D | global_control.cpp | 61 spin_mutex::scoped_lock lock(my_list_mutex); // protect my_list.empty() call in active_value() local 84 spin_mutex::scoped_lock lock(my_list_mutex); // protect my_list.empty() call in active_value() local 150 ctl->my_list_mutex.lock(); in global_control_lock() 193 spin_mutex::scoped_lock lock(c->my_list_mutex); in create() local 206 spin_mutex::scoped_lock lock(c->my_list_mutex); in destroy() local 229 spin_mutex::scoped_lock lock(c->my_list_mutex); in remove_and_check_if_empty() local 239 spin_mutex::scoped_lock lock(c->my_list_mutex); in is_present() local
|
| H A D | market.cpp | 53 mutex_type::scoped_lock lock(my_mutex); in register_client() local 59 mutex_type::scoped_lock lock(my_mutex); in unregister_and_destroy_client() local 114 mutex_type::scoped_lock lock(my_mutex); in set_active_num_workers() local 126 mutex_type::scoped_lock lock(my_mutex); in adjust_demand() local
|
| H A D | task_stream.h | 212 mutex::scoped_lock lock; in pop_specific() local 213 if( lock.try_acquire(lane.my_mutex) && !lane.my_queue.empty() ) { in pop_specific() 235 mutex::scoped_lock lock; in try_push() local 236 if( lock.try_acquire( lanes[lane_idx].my_mutex ) ) { in try_push() 250 mutex::scoped_lock lock; in try_pop() local 251 if( lock.try_acquire( lane.my_mutex ) && !lane.my_queue.empty() ) { in try_pop()
|
| H A D | semaphore.cpp | 74 __TBB_init_binsem( &my_sem.lock ); in binary_semaphore() 84 void binary_semaphore::P() { __TBB_acquire_binsem( &my_sem.lock ); } in P() 86 void binary_semaphore::V() { __TBB_release_binsem( &my_sem.lock ); } in V()
|
| /oneTBB/test/common/ |
| H A D | rwm_upgrade_downgrade.h | 37 typename RWMutex::scoped_lock lock(mutex_protecting_count, false); in operator() 41 if (lock.upgrade_to_writer()) { in operator() 50 lock.downgrade_to_reader(); in operator()
|
| /oneTBB/src/tbbmalloc/ |
| H A D | Synchronize.h | 36 void lock() { in lock() function 54 m.lock(); in scoped_lock() 58 m.lock(); in scoped_lock()
|
| /oneTBB/python/tbb/ |
| H A D | api.i | 97 std::unique_lock<std::mutex> lock(b.m); 101 b.event.wait(lock); 103 std::unique_lock<std::mutex> lock(b.m); 104 b.event.wait(lock);
|
| /oneTBB/examples/graph/dining_philosophers/ |
| H A D | dining_philosophers.cpp | 208 oneapi::tbb::spin_mutex::scoped_lock lock(my_mutex); in forward() local 216 oneapi::tbb::spin_mutex::scoped_lock lock(my_mutex); in eat() local 221 oneapi::tbb::spin_mutex::scoped_lock lock(my_mutex); in eat() local 228 oneapi::tbb::spin_mutex::scoped_lock lock(my_mutex); in think() local 233 oneapi::tbb::spin_mutex::scoped_lock lock(my_mutex); in think() local 285 oneapi::tbb::spin_mutex::scoped_lock lock(my_mutex); in main() local
|