Home
last modified time | relevance | path

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

12345678910>>...252

/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 …]
Devthread-internal.h50 /* Global function pointers to lock-related functions. NULL if locking isn't
65 * running a given event_base's loop. Requires lock. */
72 * thread. Requires lock. */
78 /** Allocate a new lock, and store it in lockvar, a void*. Sets lockvar to
84 /** Free a given lock, if it is present and locking is enabled. */
92 /** Acquire a lock. */
96 evthread_lock_fns_.lock(mode, lockvar); \
99 /** Release a lock */
116 /** Lock an event_base, if it is set up for locking. Acquires the lock
127 /** If lock debugging is enabled, and lock is non-null, assert that 'lock' is
[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/grpc-grpc/src/core/lib/iomgr/
Dcombiner.cc58 // other bits - number of items queued on the lock (STATE_ELEM_COUNT_LOW_BIT)
78 grpc_combiner* lock = static_cast<grpc_combiner*>(gpr_zalloc(sizeof(*lock))); in grpc_combiner_create() local
79 gpr_ref_init(&lock->refs, 1); in grpc_combiner_create()
80 lock->scheduler.vtable = &scheduler; in grpc_combiner_create()
81 lock->finally_scheduler.vtable = &finally_scheduler; in grpc_combiner_create()
82 gpr_atm_no_barrier_store(&lock->state, STATE_UNORPHANED); in grpc_combiner_create()
83 gpr_mpscq_init(&lock->queue); in grpc_combiner_create()
84 grpc_closure_list_init(&lock->final_list); in grpc_combiner_create()
85 GRPC_CLOSURE_INIT(&lock->offload, offload, lock, in grpc_combiner_create()
87 GRPC_COMBINER_TRACE(gpr_log(GPR_INFO, "C:%p create", lock)); in grpc_combiner_create()
[all …]
/external/rust/crates/grpcio-sys/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,
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/guava/guava-tests/test/com/google/common/util/concurrent/
DCycleDetectingLockFactoryTest.java25 import java.util.concurrent.locks.Lock;
85 // In the unittest, create each ordered factory with its own set of lock
97 lockA.lock(); in testDeadlock_twoLocks()
98 lockB.lock(); in testDeadlock_twoLocks()
104 lockB.lock(); in testDeadlock_twoLocks()
106 lockA.lock(); in testDeadlock_twoLocks()
115 lockA.lock(); in testDeadlock_twoLocks()
125 lockA.lock(); in testDeadlock_twoLocks()
131 lockA.lock(); in testDeadlock_threeLocks()
132 lockB.lock(); in testDeadlock_threeLocks()
[all …]
/external/guava/android/guava-tests/test/com/google/common/util/concurrent/
DCycleDetectingLockFactoryTest.java25 import java.util.concurrent.locks.Lock;
85 // In the unittest, create each ordered factory with its own set of lock
97 lockA.lock(); in testDeadlock_twoLocks()
98 lockB.lock(); in testDeadlock_twoLocks()
104 lockB.lock(); in testDeadlock_twoLocks()
106 lockA.lock(); in testDeadlock_twoLocks()
115 lockA.lock(); in testDeadlock_twoLocks()
125 lockA.lock(); in testDeadlock_twoLocks()
131 lockA.lock(); in testDeadlock_threeLocks()
132 lockB.lock(); in testDeadlock_threeLocks()
[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/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 …]
Datomic16.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/sfntly/cpp/src/test/
Dlock_test.cc20 #include "sfntly/port/lock.h"
29 BasicLockTestThread(Lock* lock) : lock_(lock), acquired_(0) {} in BasicLockTestThread() argument
55 Lock* lock_;
62 Lock lock; in BasicLockTest() local
63 BasicLockTestThread thread(&lock); in BasicLockTest()
70 lock.Acquire(); in BasicLockTest()
72 lock.Unlock(); in BasicLockTest()
75 lock.Acquire(); in BasicLockTest()
78 lock.Unlock(); in BasicLockTest()
81 if (lock.Try()) { in BasicLockTest()
[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/llvm-project/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 …]
Datomic16.ll13 ; X64: lock
15 ; X32: lock
18 ; X64: lock
20 ; X32: lock
23 ; X64: lock
25 ; X32: lock
28 ; X64: lock
30 ; X32: lock
41 ; X64: lock
43 ; X32: lock
[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 …]
/external/swiftshader/src/Vulkan/Debug/
DThread.cpp31 marl::lock lock(mutex); in setName() local
37 marl::lock lock(mutex); in name() local
41 void Thread::onLocationUpdate(marl::lock &lock) in onLocationUpdate() argument
58 lock.wait(stateCV, [this]() REQUIRES(mutex) { return state_ != State::Paused; }); in onLocationUpdate()
67 auto frame = pauseAtFrame.lock(); in onLocationUpdate()
80 lock.wait(stateCV, [this]() REQUIRES(mutex) { return state_ != State::Paused; }); in onLocationUpdate()
95 auto lock = ctx->lock(); in enter() local
96 frame = lock.createFrame(file, function); in enter()
97 isFunctionBreakpoint = lock.isFunctionBreakpoint(function); in enter()
101 marl::lock lock(mutex); in enter() local
[all …]
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/
D1-1.c9 * pthread_rwlock_unlock() function shall release a lock held on the
10 * read-write lock object referenced by rwlock
11 * If this function is called to release a read lock from the read-write lock object
12 * and there are other read locks currently held on this read-write lock object,
13 * the read-write lock object remains in the read locked state.
14 * If this function releases the last read lock for this read-write lock object,
15 * the read-write lock object shall be put in the unlocked state with no owners.
19 * 2. Main thread read lock 'rwlock'
20 * 3. Create a child thread, the thread read lock 'rwlock', should not block
21 * 4. Child thread unlock 'rwlock', while the main thread still hold the read lock.
[all …]
/external/python/cpython2/Lib/test/
Dlock_tests.py76 lock = self.locktype()
77 del lock
80 lock = self.locktype()
81 lock.acquire()
82 del lock
85 lock = self.locktype()
86 lock.acquire()
87 lock.release()
88 del lock
91 lock = self.locktype()
[all …]
/external/python/cpython3/Lib/test/
Dlock_tests.py97 lock = self.locktype()
98 del lock
101 lock = self.locktype()
102 self.assertRegex(repr(lock), "<unlocked .* object (.*)?at .*>")
103 del lock
106 lock = self.locktype()
107 lock.acquire()
108 self.assertRegex(repr(lock), "<locked .* object (.*)?at .*>")
109 del lock
112 lock = self.locktype()
[all …]
/external/libiio/src/
Dlock.c34 CRITICAL_SECTION lock;
36 pthread_mutex_t lock;
43 struct iio_mutex *lock = malloc(sizeof(*lock)); in iio_mutex_create() local
45 if (!lock) in iio_mutex_create()
50 InitializeCriticalSection(&lock->lock); in iio_mutex_create()
52 pthread_mutex_init(&lock->lock, NULL); in iio_mutex_create()
55 return lock; in iio_mutex_create()
58 void iio_mutex_destroy(struct iio_mutex *lock) in iio_mutex_destroy() argument
62 DeleteCriticalSection(&lock->lock); in iio_mutex_destroy()
64 pthread_mutex_destroy(&lock->lock); in iio_mutex_destroy()
[all …]
/external/parameter-framework/asio-1.10.6/include/asio/detail/
Dposix_event.hpp42 template <typename Lock>
43 void signal(Lock& lock) in signal() argument
45 this->signal_all(lock); in signal()
49 template <typename Lock>
50 void signal_all(Lock& lock) in signal_all() argument
52 ASIO_ASSERT(lock.locked()); in signal_all()
53 (void)lock; in signal_all()
59 template <typename Lock>
60 void unlock_and_signal_one(Lock& lock) in unlock_and_signal_one() argument
62 ASIO_ASSERT(lock.locked()); in unlock_and_signal_one()
[all …]
/external/rust/crates/crossbeam-utils/src/sync/
Dsharded_lock.rs15 /// The number of shards per sharded lock. Must be a power of two.
18 /// A shard containing a single reader-writer lock.
20 /// The inner reader-writer lock.
21 lock: RwLock<()>, field
25 /// Write operations will lock each shard and store the guard here. These guards get dropped at
30 /// A sharded reader-writer lock.
32 /// This lock is equivalent to [`RwLock`], except read operations are faster and write operations
37 /// and lock it. Write operations need to lock all shards in succession.
39 /// By splitting the lock into shards, concurrent read operations will in most cases choose
43 /// The priority policy of the lock is dependent on the underlying operating system's
[all …]
/external/rust/crates/spin/src/mutex/
Dspin.rs8 /// A [spin lock](https://en.m.wikipedia.org/wiki/Spinlock) providing mutually exclusive access to …
15 /// let lock = spin::mutex::SpinMutex::new(0);
18 /// *lock.lock() = 2;
21 /// let answer = *lock.lock();
41 /// let mut guard = my_lock.lock();
44 /// // Release the lock to prevent a deadlock
52 /// let answer = { *spin_mutex.lock() };
56 pub(crate) lock: AtomicBool, field
62 /// When the guard falls out of scope it will release the lock.
64 lock: &'a AtomicBool, field
[all …]

12345678910>>...252