Home
last modified time | relevance | path

Searched refs:lock (Results 1 – 25 of 2315) sorted by relevance

12345678910>>...93

/external/python/cpython2/Python/
Dthread_lwp.h9 struct lock { struct
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
80 dprintf(("PyThread_free_lock(%p) called\n", lock)); in PyThread_free_lock()
[all …]
Dthread_pthread.h259 sem_t *lock; in PyThread_allocate_lock() local
266 lock = (sem_t *)malloc(sizeof(sem_t)); in PyThread_allocate_lock()
268 if (lock) { in PyThread_allocate_lock()
269 status = sem_init(lock,0,1); in PyThread_allocate_lock()
273 free((void *)lock); in PyThread_allocate_lock()
274 lock = NULL; in PyThread_allocate_lock()
278 dprintf(("PyThread_allocate_lock() -> %p\n", lock)); in PyThread_allocate_lock()
279 return (PyThread_type_lock)lock; in PyThread_allocate_lock()
283 PyThread_free_lock(PyThread_type_lock lock) in PyThread_free_lock() argument
285 sem_t *thelock = (sem_t *)lock; in PyThread_free_lock()
[all …]
Dthread_atheos.h156 fastmutex_t *lock; in PyThread_allocate_lock() local
166 lock = (fastmutex_t *) malloc(sizeof(fastmutex_t)); in PyThread_allocate_lock()
167 if (lock == NULL) { in PyThread_allocate_lock()
176 if (fastmutex_create(name, lock) < 0) { in PyThread_allocate_lock()
179 free(lock); in PyThread_allocate_lock()
180 lock = NULL; in PyThread_allocate_lock()
182 dprintf(("PyThread_allocate_lock()-> %p\n", lock)); in PyThread_allocate_lock()
183 return (PyThread_type_lock) lock; in PyThread_allocate_lock()
197 void PyThread_free_lock(PyThread_type_lock lock) in PyThread_free_lock() argument
199 dprintf(("PyThread_free_lock(%p) called\n", lock)); in PyThread_free_lock()
[all …]
Dthread_cthread.h68 mutex_t lock; in PyThread_allocate_lock() local
74 lock = mutex_alloc(); in PyThread_allocate_lock()
75 if (mutex_init(lock)) { in PyThread_allocate_lock()
77 free((void *) lock); in PyThread_allocate_lock()
78 lock = 0; in PyThread_allocate_lock()
80 dprintf(("PyThread_allocate_lock() -> %p\n", lock)); in PyThread_allocate_lock()
81 return (PyThread_type_lock) lock; in PyThread_allocate_lock()
85 PyThread_free_lock(PyThread_type_lock lock) in PyThread_free_lock() argument
87 dprintf(("PyThread_free_lock(%p) called\n", lock)); in PyThread_free_lock()
88 mutex_free(lock); in PyThread_free_lock()
[all …]
Dthread_solaris.h82 mutex_t *lock; in PyThread_allocate_lock() local
88 lock = (mutex_t *) malloc(sizeof(mutex_t)); in PyThread_allocate_lock()
89 if (mutex_init(lock, USYNC_THREAD, 0)) { in PyThread_allocate_lock()
91 free((void *) lock); in PyThread_allocate_lock()
92 lock = 0; in PyThread_allocate_lock()
94 dprintf(("PyThread_allocate_lock() -> %p\n", lock)); in PyThread_allocate_lock()
95 return (PyThread_type_lock) lock; in PyThread_allocate_lock()
99 PyThread_free_lock(PyThread_type_lock lock) in PyThread_free_lock() argument
101 dprintf(("PyThread_free_lock(%p) called\n", lock)); in PyThread_free_lock()
102 mutex_destroy((mutex_t *) lock); in PyThread_free_lock()
[all …]
Dthread_pth.h90 pth_lock *lock; in PyThread_allocate_lock() local
97 lock = (pth_lock *) malloc(sizeof(pth_lock)); in PyThread_allocate_lock()
98 memset((void *)lock, '\0', sizeof(pth_lock)); in PyThread_allocate_lock()
99 if (lock) { in PyThread_allocate_lock()
100 lock->locked = 0; in PyThread_allocate_lock()
101 status = pth_mutex_init(&lock->mut); in PyThread_allocate_lock()
103 status = pth_cond_init(&lock->lock_released); in PyThread_allocate_lock()
106 free((void *)lock); in PyThread_allocate_lock()
107 lock = NULL; in PyThread_allocate_lock()
110 dprintf(("PyThread_allocate_lock() -> %p\n", lock)); in PyThread_allocate_lock()
[all …]
/external/libevent/
Devthread.c118 target->lock == cbs->lock && in evthread_set_lock_callbacks()
127 if (cbs->alloc && cbs->free && cbs->lock && cbs->unlock) { in evthread_set_lock_callbacks()
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()
221 EVUTIL_ASSERT(locktype == lock->locktype); in debug_lock_free()
222 EVUTIL_ASSERT(DEBUG_LOCK_SIG == lock->signature); in debug_lock_free()
224 original_lock_fns_.free(lock->lock, in debug_lock_free()
[all …]
Devthread-internal.h93 evthread_lock_fns_.lock(mode, lockvar); \
126 #define EVLOCK_ASSERT_LOCKED(lock) \ argument
128 if ((lock) && evthread_lock_debugging_enabled_) { \
129 EVUTIL_ASSERT(evthread_is_debug_lock_held_(lock)); \
135 static inline int EVLOCK_TRY_LOCK_(void *lock);
137 EVLOCK_TRY_LOCK_(void *lock) in EVLOCK_TRY_LOCK_() argument
139 if (lock && evthread_lock_fns_.lock) { in EVLOCK_TRY_LOCK_()
140 int r = evthread_lock_fns_.lock(EVTHREAD_TRY, lock); in EVLOCK_TRY_LOCK_()
171 #define EVTHREAD_COND_WAIT(cond, lock) \ argument
172 ( (cond) ? evthread_cond_fns_.wait_condition((cond), (lock), NULL) : 0 )
[all …]
Devthread_win32.c53 CRITICAL_SECTION *lock = mm_malloc(sizeof(CRITICAL_SECTION)); in evthread_win32_lock_create() local
54 if (!lock) in evthread_win32_lock_create()
56 if (InitializeCriticalSectionAndSpinCount(lock, SPIN_COUNT) == 0) { in evthread_win32_lock_create()
57 mm_free(lock); in evthread_win32_lock_create()
60 return lock; in evthread_win32_lock_create()
66 CRITICAL_SECTION *lock = lock_; in evthread_win32_lock_free() local
67 DeleteCriticalSection(lock); in evthread_win32_lock_free()
68 mm_free(lock); in evthread_win32_lock_free()
74 CRITICAL_SECTION *lock = lock_; in evthread_win32_lock() local
76 return ! TryEnterCriticalSection(lock); in evthread_win32_lock()
[all …]
/external/grpc-grpc/src/core/lib/iomgr/
Dcombiner.cc78 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()
88 return lock; in grpc_combiner_create()
[all …]
/external/guava/guava-tests/test/com/google/common/util/concurrent/
DCycleDetectingLockFactoryTest.java102 lockA.lock(); in testDeadlock_twoLocks()
103 lockB.lock(); in testDeadlock_twoLocks()
109 lockB.lock(); in testDeadlock_twoLocks()
111 lockA.lock(); in testDeadlock_twoLocks()
120 lockA.lock(); in testDeadlock_twoLocks()
130 lockA.lock(); in testDeadlock_twoLocks()
136 lockA.lock(); in testDeadlock_threeLocks()
137 lockB.lock(); in testDeadlock_threeLocks()
142 lockB.lock(); in testDeadlock_threeLocks()
143 lockC.lock(); in testDeadlock_threeLocks()
[all …]
/external/linux-kselftest/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/
Dlocks.h26 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()
61 static inline bool lock_impl_trylock(struct lock_impl *lock) in lock_impl_trylock() argument
65 return __sync_bool_compare_and_swap(&lock->locked, false, true); in lock_impl_trylock()
[all …]
/external/guava/guava/src/com/google/common/util/concurrent/
DMonitor.java305 this.condition = monitor.lock.newCondition(); in Guard()
325 private final ReentrantLock lock; field in Monitor
350 this.lock = new ReentrantLock(fair); in Monitor()
357 lock.lock(); in enter()
364 lock.lockInterruptibly(); in enterInterruptibly()
374 final ReentrantLock lock = this.lock; in enter() local
375 if (!fair && lock.tryLock()) { in enter()
383 return lock.tryLock(timeoutNanos, TimeUnit.NANOSECONDS); in enter()
402 return lock.tryLock(time, unit); in enterInterruptibly()
413 return lock.tryLock(); in tryEnter()
[all …]
/external/libchrome/base/synchronization/
Dlock_unittest.cc21 explicit BasicLockTestThread(Lock* lock) : lock_(lock), acquired_(0) {} in BasicLockTestThread() argument
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()
76 lock.Release(); in TEST()
80 lock.Acquire(); in TEST()
[all …]
/external/sfntly/cpp/src/test/
Dlock_test.cc29 BasicLockTestThread(Lock* lock) : lock_(lock), acquired_(0) {} in BasicLockTestThread() argument
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()
84 lock.Unlock(); in BasicLockTest()
88 lock.Acquire(); in BasicLockTest()
[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/androidplot/AndroidPlot-Core/src/main/java/com/androidplot/xy/
DSimpleXYSeries.java40 lock.readLock().lock(); in onBeforeDraw()
45 lock.readLock().unlock(); in onAfterDraw()
56 private ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true); field in SimpleXYSeries
95 lock.writeLock().lock(); in useImplicitXVals()
99 lock.writeLock().unlock(); in useImplicitXVals()
111 lock.writeLock().lock(); in setModel()
155 lock.writeLock().unlock(); in setModel()
165 lock.writeLock().lock(); in setX()
169 lock.writeLock().unlock(); in setX()
179 lock.writeLock().lock(); in setY()
[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/swiftshader/third_party/llvm-7.0/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/python/cpython3/Lib/test/
Dlock_tests.py91 lock = self.locktype()
92 del lock
95 lock = self.locktype()
96 self.assertRegex(repr(lock), "<unlocked .* object (.*)?at .*>")
97 del lock
100 lock = self.locktype()
101 lock.acquire()
102 self.assertRegex(repr(lock), "<locked .* object (.*)?at .*>")
103 del lock
106 lock = self.locktype()
[all …]
/external/boringssl/src/crypto/
Dthread_pthread.c30 void CRYPTO_MUTEX_init(CRYPTO_MUTEX *lock) { in CRYPTO_MUTEX_init() argument
31 if (pthread_rwlock_init((pthread_rwlock_t *) lock, NULL) != 0) { in CRYPTO_MUTEX_init()
36 void CRYPTO_MUTEX_lock_read(CRYPTO_MUTEX *lock) { in CRYPTO_MUTEX_lock_read() argument
37 if (pthread_rwlock_rdlock((pthread_rwlock_t *) lock) != 0) { in CRYPTO_MUTEX_lock_read()
42 void CRYPTO_MUTEX_lock_write(CRYPTO_MUTEX *lock) { in CRYPTO_MUTEX_lock_write() argument
43 if (pthread_rwlock_wrlock((pthread_rwlock_t *) lock) != 0) { in CRYPTO_MUTEX_lock_write()
48 void CRYPTO_MUTEX_unlock_read(CRYPTO_MUTEX *lock) { in CRYPTO_MUTEX_unlock_read() argument
49 if (pthread_rwlock_unlock((pthread_rwlock_t *) lock) != 0) { in CRYPTO_MUTEX_unlock_read()
54 void CRYPTO_MUTEX_unlock_write(CRYPTO_MUTEX *lock) { in CRYPTO_MUTEX_unlock_write() argument
55 if (pthread_rwlock_unlock((pthread_rwlock_t *) lock) != 0) { in CRYPTO_MUTEX_unlock_write()
[all …]
/external/robolectric-shadows/robolectric/src/test/java/org/robolectric/shadows/
DShadowPowerManagerTest.java38 PowerManager.WakeLock lock = powerManager.newWakeLock(0, "TAG"); in acquire_shouldAcquireAndReleaseReferenceCountedLock() local
39 assertThat(lock.isHeld()).isFalse(); in acquire_shouldAcquireAndReleaseReferenceCountedLock()
40 lock.acquire(); in acquire_shouldAcquireAndReleaseReferenceCountedLock()
41 assertThat(lock.isHeld()).isTrue(); in acquire_shouldAcquireAndReleaseReferenceCountedLock()
42 lock.acquire(); in acquire_shouldAcquireAndReleaseReferenceCountedLock()
44 assertThat(lock.isHeld()).isTrue(); in acquire_shouldAcquireAndReleaseReferenceCountedLock()
45 lock.release(); in acquire_shouldAcquireAndReleaseReferenceCountedLock()
47 assertThat(lock.isHeld()).isTrue(); in acquire_shouldAcquireAndReleaseReferenceCountedLock()
48 lock.release(); in acquire_shouldAcquireAndReleaseReferenceCountedLock()
49 assertThat(lock.isHeld()).isFalse(); in acquire_shouldAcquireAndReleaseReferenceCountedLock()
[all …]
/external/parameter-framework/asio-1.10.6/include/asio/detail/
Dposix_event.hpp43 void signal(Lock& lock) in signal() argument
45 this->signal_all(lock); in signal()
50 void signal_all(Lock& lock) in signal_all() argument
52 ASIO_ASSERT(lock.locked()); in signal_all()
53 (void)lock; in signal_all()
60 void unlock_and_signal_one(Lock& lock) in unlock_and_signal_one() argument
62 ASIO_ASSERT(lock.locked()); in unlock_and_signal_one()
65 lock.unlock(); in unlock_and_signal_one()
72 bool maybe_unlock_and_signal_one(Lock& lock) in maybe_unlock_and_signal_one() argument
74 ASIO_ASSERT(lock.locked()); in maybe_unlock_and_signal_one()
[all …]

12345678910>>...93