Home
last modified time | relevance | path

Searched full:lock (Results 1 – 25 of 7968) sorted by relevance

12345678910>>...319

/external/pigweed/pw_sync/pw_sync_private/
Dborrow_lockable_tests.h16 /// This file contains tests that can be used to verify a lock type can be
22 /// * If a lock is not \em TimedLockable, use `ADD_BORROWABLE_LOCK_TESTS`, e.g.
25 /// * If a lock is \em TimedLockable, use `ADD_BORROWABLE_TIMED_LOCK_TESTS` and
31 /// `ADD_BORROWABLE_LOCK_NAMED_TESTS(MyTestSuite, pw::my_module::Lock);`.
56 /// actually locking. The lock state for these types can be accessed using
60 template <typename Lock, typename = void>
63 template <typename Lock>
64 struct has_locked<Lock, std::void_t<decltype(std::declval<Lock>().locked())>>
68 /// Checks if a lock's state matches the expected state.
71 /// meet C++'s \em Lockable named requirement. This method is a no-op for lock
[all …]
/external/sdv/vsomeip/third_party/boost/thread/test/
Dtest_lock_concept.cpp19 template<typename Mutex,typename Lock>
25 Lock lock(m); in operator ()() local
27 BOOST_CHECK(lock); in operator ()()
28 BOOST_CHECK(lock.owns_lock()); in operator ()()
32 template<typename Mutex,typename Lock>
47 Lock lock(m); in locking_thread() local
50 locked=lock.owns_lock(); in locking_thread()
63 Lock lock(m); in operator ()() local
65 typedef test_initially_unlocked_if_other_thread_has_lock<Mutex,Lock> this_type; in operator ()()
78 lock.unlock(); in operator ()()
[all …]
Dtest_mutex.cpp37 // Test the lock's constructors. in operator ()()
39 lock_type lock(mutex, boost::defer_lock); in operator ()() local
40 BOOST_CHECK(!lock); in operator ()()
42 lock_type lock(mutex); in operator ()() local
43 BOOST_CHECK(lock ? true : false); in operator ()()
48 // Test the lock and the mutex with condition variables. in operator ()()
51 BOOST_CHECK(!condition.timed_wait(lock, xt)); in operator ()()
52 BOOST_CHECK(lock ? true : false); in operator ()()
54 // Test the lock and unlock methods. in operator ()()
55 lock.unlock(); in operator ()()
[all …]
/external/bcc/libbpf-tools/
Dklockstat.bpf.c27 * Uniquely identifies a task grabbing a particular lock; a task can only hold
28 * the same lock once (non-recursive mutexes).
54 * Multiple call sites may have the same underlying lock, but we only know the
84 static void lock_contended(void *ctx, void *lock) in lock_contended() argument
90 if (targ_lock && targ_lock != lock) in lock_contended()
97 li->lock_ptr = (u64)lock; in lock_contended()
116 tl.lock_ptr = (u64)lock; in lock_contended()
120 static void lock_aborted(void *lock) in lock_aborted() argument
125 if (targ_lock && targ_lock != lock) in lock_aborted()
131 tl.lock_ptr = (u64)lock; in lock_aborted()
[all …]
/external/libevent/
Devthread.c107 event_warnx("Trying to disable lock functions after " in evthread_set_lock_callbacks()
118 target->lock == cbs->lock && in evthread_set_lock_callbacks()
123 event_warnx("Can't change lock callbacks once they have been " in evthread_set_lock_callbacks()
127 if (cbs->alloc && cbs->free && cbs->lock && cbs->unlock) { in evthread_set_lock_callbacks()
189 * lock to protect count. */
191 void *lock; member
201 if (!(result->lock = original_lock_fns_.alloc( in debug_lock_alloc()
207 result->lock = NULL; in debug_lock_alloc()
219 struct debug_lock *lock = lock_; in debug_lock_free() local
220 EVUTIL_ASSERT(lock->count == 0); in debug_lock_free()
[all …]
/external/cronet/base/synchronization/
Dlock_unittest.cc5 #include "base/synchronization/lock.h"
21 explicit BasicLockTestThread(Lock* lock) : lock_(lock), acquired_(0) {} in BasicLockTestThread() argument
50 raw_ptr<Lock> lock_;
55 Lock lock; in TEST() local
56 BasicLockTestThread thread(&lock); in TEST()
63 lock.Acquire(); in TEST()
65 lock.Release(); in TEST()
68 lock.Acquire(); in TEST()
71 lock.Release(); in TEST()
74 if (lock.Try()) { in TEST()
[all …]
/external/python/cpython2/Python/
Dthread_lwp.h9 struct lock { struct
59 * Lock support.
63 struct lock *lock; in PyThread_allocate_lock() local
70 lock = (struct lock *) malloc(sizeof(struct lock)); in PyThread_allocate_lock()
71 lock->lock_locked = 0; in PyThread_allocate_lock()
72 (void) mon_create(&lock->lock_monitor); in PyThread_allocate_lock()
73 (void) cv_create(&lock->lock_condvar, lock->lock_monitor); in PyThread_allocate_lock()
74 dprintf(("PyThread_allocate_lock() -> %p\n", lock)); in PyThread_allocate_lock()
75 return (PyThread_type_lock) lock; in PyThread_allocate_lock()
78 void PyThread_free_lock(PyThread_type_lock lock) in PyThread_free_lock() argument
[all …]
/external/libxkbcommon/test/data/types/
Dlevel529 modifiers = Shift+Lock+LevelThree+LevelFive;
32 map[Lock] = Level2;
35 map[Lock+LevelThree] = Level4;
36 map[Lock+Shift+LevelThree] = Level3;
40 map[Lock+LevelFive] = Level6;
43 map[Lock+LevelThree+LevelFive] = Level8;
44 map[Lock+Shift+LevelThree+LevelFive] = Level7;
57 // Level5-Lock is implemented by using NumLock, because a real modifier
60 modifiers = Shift + Lock + LevelThree + NumLock + LevelFive;
82 // Lock has no effect
[all …]
/external/sdv/vsomeip/third_party/boost/thread/doc/
Dcondition_variables.qbk43 boost::unique_lock<boost::mutex> lock(mut);
46 cond.wait(lock);
51 Notice that the `lock` is passed to `wait`: `wait` will atomically add the
70 boost::lock_guard<boost::mutex> lock(mut);
81 is more general, and will work with any kind of lock or mutex, whereas
82 `condition_variable` requires that the lock passed to `wait` is an instance of
103 void wait(boost::unique_lock<boost::mutex>& lock);
106 void wait(boost::unique_lock<boost::mutex>& lock,predicate_type predicate);
111 unique_lock<mutex>& lock,
117 unique_lock<mutex>& lock,
[all …]
/external/guava/guava-tests/test/com/google/common/util/concurrent/
DCycleDetectingLockFactoryTest.java28 import java.util.concurrent.locks.Lock;
86 // In the unittest, create each ordered factory with its own set of lock
98 lockA.lock(); in testDeadlock_twoLocks()
99 lockB.lock(); in testDeadlock_twoLocks()
105 lockB.lock(); in testDeadlock_twoLocks()
107 assertThrows(PotentialDeadlockException.class, () -> lockA.lock()); in testDeadlock_twoLocks()
111 expected = assertThrows(PotentialDeadlockException.class, () -> lockA.lock()); in testDeadlock_twoLocks()
117 lockA.lock(); in testDeadlock_twoLocks()
123 lockA.lock(); in testDeadlock_threeLocks()
124 lockB.lock(); in testDeadlock_threeLocks()
[all …]
/external/guava/android/guava-tests/test/com/google/common/util/concurrent/
DCycleDetectingLockFactoryTest.java28 import java.util.concurrent.locks.Lock;
86 // In the unittest, create each ordered factory with its own set of lock
98 lockA.lock(); in testDeadlock_twoLocks()
99 lockB.lock(); in testDeadlock_twoLocks()
105 lockB.lock(); in testDeadlock_twoLocks()
107 assertThrows(PotentialDeadlockException.class, () -> lockA.lock()); in testDeadlock_twoLocks()
111 expected = assertThrows(PotentialDeadlockException.class, () -> lockA.lock()); in testDeadlock_twoLocks()
117 lockA.lock(); in testDeadlock_twoLocks()
123 lockA.lock(); in testDeadlock_threeLocks()
124 lockB.lock(); in testDeadlock_threeLocks()
[all …]
/external/pigweed/pw_sync/public/pw_sync/
Dlock_traits.h19 /// This file provide trait types that can be used to check C++ lock-related
24 /// Checks if a type is a basic lock.
26 /// If `Lock` satisfies \em BasicLockable, provides the member constant value
30 template <typename Lock, typename = void>
33 template <typename Lock>
34 struct is_basic_lockable<Lock,
35 std::void_t<decltype(std::declval<Lock>().lock()),
36 decltype(std::declval<Lock>().unlock())>>
40 /// Helper variable template for `is_basic_lockable<Lock>::value`.
41 template <typename Lock>
[all …]
/external/grpc-grpc/src/core/lib/iomgr/
Dcombiner.cc48 static void combiner_exec(grpc_core::Combiner* lock, grpc_closure* closure,
50 static void combiner_finally_exec(grpc_core::Combiner* lock,
57 grpc_core::Combiner* lock = new grpc_core::Combiner(); in grpc_combiner_create() local
58 lock->event_engine = event_engine; in grpc_combiner_create()
59 gpr_ref_init(&lock->refs, 1); in grpc_combiner_create()
60 gpr_atm_no_barrier_store(&lock->state, STATE_UNORPHANED); in grpc_combiner_create()
61 grpc_closure_list_init(&lock->final_list); in grpc_combiner_create()
62 GRPC_COMBINER_TRACE(gpr_log(GPR_INFO, "C:%p create", lock)); in grpc_combiner_create()
63 return lock; in grpc_combiner_create()
66 static void really_destroy(grpc_core::Combiner* lock) { in really_destroy() argument
[all …]
/external/rust/crates/grpcio-sys/grpc/src/core/lib/iomgr/
Dcombiner.cc47 static void combiner_exec(grpc_core::Combiner* lock, grpc_closure* closure,
49 static void combiner_finally_exec(grpc_core::Combiner* lock,
56 grpc_core::Combiner* lock = new grpc_core::Combiner(); in grpc_combiner_create() local
57 gpr_ref_init(&lock->refs, 1); in grpc_combiner_create()
58 gpr_atm_no_barrier_store(&lock->state, STATE_UNORPHANED); in grpc_combiner_create()
59 grpc_closure_list_init(&lock->final_list); in grpc_combiner_create()
60 GRPC_CLOSURE_INIT(&lock->offload, offload, lock, nullptr); in grpc_combiner_create()
61 GRPC_COMBINER_TRACE(gpr_log(GPR_INFO, "C:%p create", lock)); in grpc_combiner_create()
62 return lock; in grpc_combiner_create()
65 static void really_destroy(grpc_core::Combiner* lock) { in really_destroy() argument
[all …]
/external/rust/crates/spin/src/mutex/
Dfair.rs5 //! starvation of threads that are waiting for the lock.
19 // The lowest bit of `lock` is used to indicate whether the mutex is locked or not. The rest of the…
27 /// A [spin lock](https://en.m.wikipedia.org/wiki/Spinlock) providing mutually exclusive access to …
35 /// let lock = spin::mutex::FairMutex::<_>::new(0);
38 /// *lock.lock() = 2;
41 /// let answer = *lock.lock();
61 /// let mut guard = my_lock.lock();
64 /// // Release the lock to prevent a deadlock
72 /// let answer = { *spin_mutex.lock() };
77 pub(crate) lock: AtomicUsize, field
[all …]
/external/cronet/base/task/common/
Dchecked_lock_unittest.cc22 // Adapted from base::Lock's BasicLockTestThread to make sure
26 explicit BasicLockTestThread(CheckedLock* lock) in BasicLockTestThread() argument
27 : SimpleThread("BasicLockTestThread"), lock_(lock), acquired_(0) {} in BasicLockTestThread()
55 explicit BasicLockAcquireAndWaitThread(CheckedLock* lock) in BasicLockAcquireAndWaitThread() argument
57 lock_(lock), in BasicLockAcquireAndWaitThread()
88 CheckedLock lock; in TEST() local
89 BasicLockTestThread thread(&lock); in TEST()
95 lock.Acquire(); in TEST()
97 lock.Release(); in TEST()
100 lock.Acquire(); in TEST()
[all …]
/external/libchrome/base/synchronization/
Dlock_unittest.cc5 #include "base/synchronization/lock.h"
21 explicit BasicLockTestThread(Lock* lock) : lock_(lock), acquired_(0) {} in BasicLockTestThread() argument
47 Lock* lock_;
54 Lock lock; in TEST() local
55 BasicLockTestThread thread(&lock); in TEST()
62 lock.Acquire(); in TEST()
64 lock.Release(); in TEST()
67 lock.Acquire(); in TEST()
70 lock.Release(); in TEST()
73 if (lock.Try()) { in TEST()
[all …]
/external/cronet/base/allocator/partition_allocator/src/partition_alloc/
Dpartition_lock_unittest.cc17 Lock lock; in TEST() local
18 lock.Acquire(); in TEST()
19 lock.Release(); in TEST()
24 Lock g_lock;
38 explicit ThreadDelegateForContended(Lock& start_lock, in ThreadDelegateForContended()
39 Lock& lock, in ThreadDelegateForContended() argument
43 lock_(lock), in ThreadDelegateForContended()
59 Lock& start_lock_;
60 Lock& lock_;
73 Lock lock; in TEST() local
[all …]
/external/sdv/vsomeip/third_party/boost/asio/include/boost/asio/detail/
Dwin_event.hpp44 template <typename Lock>
45 void signal(Lock& lock) in signal() argument
47 this->signal_all(lock); in signal()
51 template <typename Lock>
52 void signal_all(Lock& lock) in signal_all() argument
54 BOOST_ASIO_ASSERT(lock.locked()); in signal_all()
55 (void)lock; in signal_all()
61 template <typename Lock>
62 void unlock_and_signal_one(Lock& lock) in unlock_and_signal_one() argument
64 BOOST_ASIO_ASSERT(lock.locked()); in unlock_and_signal_one()
[all …]
Dstd_event.hpp49 template <typename Lock>
50 void signal(Lock& lock) in signal() argument
52 this->signal_all(lock); in signal()
56 template <typename Lock>
57 void signal_all(Lock& lock) in signal_all() argument
59 BOOST_ASIO_ASSERT(lock.locked()); in signal_all()
60 (void)lock; in signal_all()
66 template <typename Lock>
67 void unlock_and_signal_one(Lock& lock) in unlock_and_signal_one() argument
69 BOOST_ASIO_ASSERT(lock.locked()); in unlock_and_signal_one()
[all …]
/external/llvm/test/CodeGen/X86/
Datomic8.ll12 ; X64: lock
14 ; X32: lock
17 ; X64: lock
19 ; X32: lock
22 ; X64: lock
24 ; X32: lock
27 ; X64: lock
29 ; X32: lock
40 ; X64: lock
42 ; X32: lock
[all …]
/external/linux-kselftest/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/
Dlocks.h20 /* Only use one lock mechanism. Select which one. */
26 static inline void lock_impl_lock(struct lock_impl *lock) in lock_impl_lock() argument
28 BUG_ON(pthread_mutex_lock(&lock->mutex)); in lock_impl_lock()
31 static inline void lock_impl_unlock(struct lock_impl *lock) in lock_impl_unlock() argument
33 BUG_ON(pthread_mutex_unlock(&lock->mutex)); in lock_impl_unlock()
36 static inline bool lock_impl_trylock(struct lock_impl *lock) in lock_impl_trylock() argument
38 int err = pthread_mutex_trylock(&lock->mutex); in lock_impl_trylock()
47 static inline void lock_impl_init(struct lock_impl *lock) in lock_impl_init() argument
49 pthread_mutex_init(&lock->mutex, NULL); in lock_impl_init()
55 /* Spinlock that assumes that it always gets the lock immediately. */
[all …]
/external/robolectric/robolectric/src/test/java/org/robolectric/shadows/
DShadowPowerManagerTest.java55 PowerManager.WakeLock lock = powerManager.newWakeLock(0, "TAG"); in acquire_shouldAcquireAndReleaseReferenceCountedLock() local
56 assertThat(lock.isHeld()).isFalse(); in acquire_shouldAcquireAndReleaseReferenceCountedLock()
57 lock.acquire(); in acquire_shouldAcquireAndReleaseReferenceCountedLock()
58 assertThat(lock.isHeld()).isTrue(); in acquire_shouldAcquireAndReleaseReferenceCountedLock()
59 lock.acquire(); in acquire_shouldAcquireAndReleaseReferenceCountedLock()
61 assertThat(lock.isHeld()).isTrue(); in acquire_shouldAcquireAndReleaseReferenceCountedLock()
62 lock.release(); in acquire_shouldAcquireAndReleaseReferenceCountedLock()
64 assertThat(lock.isHeld()).isTrue(); in acquire_shouldAcquireAndReleaseReferenceCountedLock()
65 lock.release(); in acquire_shouldAcquireAndReleaseReferenceCountedLock()
66 assertThat(lock.isHeld()).isFalse(); in acquire_shouldAcquireAndReleaseReferenceCountedLock()
[all …]
/external/guice/core/src/com/google/inject/internal/
DCycleDetectingLock.java16 import java.util.concurrent.locks.Lock;
20 * Simplified version of {@link Lock} that is special due to how it handles deadlocks detection.
25 * @param <ID> Lock identification provided by the client, is returned unmodified to the client when
26 * lock cycle is detected to identify it. Only toString() needs to be implemented. Lock
28 * heavy IDs. Lock is referenced by a lock factory as long as it's owned by a thread.
36 * Takes a lock in a blocking fashion in case no potential deadlocks are detected. If the lock was
41 * the last lock in the list is the one that the thread is currently waiting for. Returned map is
49 /** Unlocks previously locked lock. */
58 * A takes lock L and creates singleton class CA depending on the singleton class CB. Meanwhile
59 * thread B is creating class CB and is waiting on the lock L. Issue happens due to client code
[all …]
/external/curl/tests/data/
Dtest155422 -> Mutex lock
24 -> Mutex lock
26 -> Mutex lock
28 -> Mutex lock
30 -> Mutex lock
32 -> Mutex lock
34 -> Mutex lock
36 -> Mutex lock
39 -> Mutex lock
41 -> Mutex lock
[all …]

12345678910>>...319