Searched refs:lock (Results 1 - 25 of 700) sorted by relevance

1234567891011>>

/haiku/src/system/libroot/os/locks/
H A Drecursive_lock.cpp17 // #pragma mark - recursive lock
21 __recursive_lock_get_recursion(recursive_lock *lock) argument
23 if (lock->holder == find_thread(NULL))
24 return lock->recursion;
31 __recursive_lock_init(recursive_lock *lock, const char *name) argument
33 recursive_lock_init_etc(lock, name, 0);
38 __recursive_lock_init_etc(recursive_lock *lock, const char *name, uint32 flags) argument
40 lock->holder = -1;
41 lock->recursion = 0;
42 mutex_init_etc(&lock
47 __recursive_lock_destroy(recursive_lock *lock) argument
57 __recursive_lock_lock(recursive_lock *lock) argument
72 __recursive_lock_unlock(recursive_lock *lock) argument
[all...]
H A Drw_lock.cpp23 rw_lock_wait(rw_lock *lock, bool writer) argument
30 if (lock->waiters != NULL)
31 lock->last_waiter->next = &waiter;
33 lock->waiters = &waiter;
35 lock->last_waiter = &waiter;
39 mutex_unlock(&lock->lock);
46 // and lock it again before returning
47 mutex_lock(&lock->lock);
53 rw_lock_unblock(rw_lock *lock) argument
83 __rw_lock_init(rw_lock *lock, const char *name) argument
90 __rw_lock_init_etc(rw_lock *lock, const char *name, uint32 flags) argument
102 __rw_lock_destroy(rw_lock *lock) argument
117 __rw_lock_read_lock(rw_lock *lock) argument
136 __rw_lock_read_unlock(rw_lock *lock) argument
164 __rw_lock_write_lock(rw_lock *lock) argument
197 __rw_lock_write_unlock(rw_lock *lock) argument
[all...]
H A Dmutex.cpp31 __mutex_init(mutex *lock, const char *name) argument
33 lock->name = name;
34 lock->lock = 0;
35 lock->flags = 0;
40 __mutex_init_etc(mutex *lock, const char *name, uint32 flags) argument
42 lock->name = (flags & MUTEX_FLAG_CLONE_NAME) != 0 ? strdup(name) : name;
43 lock->lock = 0;
44 lock
52 __mutex_destroy(mutex *lock) argument
60 __mutex_lock(mutex *lock) argument
84 __mutex_unlock(mutex *lock) argument
[all...]
/haiku/src/add-ons/kernel/bus_managers/scsi/
H A Dscsi_lock.h22 // enhanced spinlock that automatically disables irqs when lock is hold
24 spinlock lock; // normal spinlock member in struct:spinlock_irq
30 spinlock_irq_init(spinlock_irq *lock) argument
32 B_INITIALIZE_SPINLOCK(&lock->lock);
36 acquire_spinlock_irq(spinlock_irq *lock) argument
40 acquire_spinlock(&lock->lock);
41 lock->prev_irq_state = prev_irq_state;
45 release_spinlock_irq(spinlock_irq *lock) argument
[all...]
/haiku/src/libs/compat/freebsd_network/compat/sys/
H A Dsx.h12 #include <lock.h>
19 #define sx_init(lock, name) rw_lock_init(&(lock)->l, name)
20 #define sx_xlock(lock) rw_lock_write_lock(&(lock)->l)
21 #define sx_xunlock(lock) rw_lock_write_unlock(&(lock)->l)
22 #define sx_destroy(lock) rw_lock_destroy(&(lock)->l)
H A D_mutex.h10 #include <lock.h>
18 mutex lock; member in struct:mtx::__anon159::__anon160
23 spinlock lock; member in struct:mtx::__anon159::__anon161
/haiku/headers/private/graphics/radeon_hd/
H A Dlock.h15 typedef struct lock { struct
18 } lock; typedef in typeref:struct:lock
22 init_lock(struct lock *lock, const char *name) argument
24 lock->sem = create_sem(0, name);
25 lock->count = 0;
27 return lock->sem < B_OK ? lock->sem : B_OK;
32 uninit_lock(struct lock *lock) argument
39 acquire_lock(struct lock *lock) argument
49 release_lock(struct lock *lock) argument
60 Autolock(struct lock &lock) argument
[all...]
/haiku/headers/private/graphics/intel_extreme/
H A Dlock.h15 struct lock { struct
22 init_lock(struct lock *lock, const char *name) argument
24 lock->sem = create_sem(0, name);
25 lock->count = 0;
27 return lock->sem < B_OK ? lock->sem : B_OK;
32 uninit_lock(struct lock *lock) argument
34 delete_sem(lock
39 acquire_lock(struct lock *lock) argument
49 release_lock(struct lock *lock) argument
60 Autolock(struct lock &lock) argument
[all...]
/haiku/src/libs/posix_error_mapper/
H A Dpthread_spinlock.cpp12 (pthread_spinlock_t* lock, int pshared),
13 return B_TO_POSITIVE_ERROR(sReal_pthread_spin_init(lock, pshared));
17 WRAPPER_FUNCTION(int, pthread_spin_destroy, (pthread_spinlock_t* lock),
18 return B_TO_POSITIVE_ERROR(sReal_pthread_spin_destroy(lock));
22 WRAPPER_FUNCTION(int, pthread_spin_lock, (pthread_spinlock_t* lock),
23 return B_TO_POSITIVE_ERROR(sReal_pthread_spin_lock(lock));
27 WRAPPER_FUNCTION(int, pthread_spin_trylock, (pthread_spinlock_t* lock),
28 return B_TO_POSITIVE_ERROR(sReal_pthread_spin_trylock(lock));
32 WRAPPER_FUNCTION(int, pthread_spin_unlock, (pthread_spinlock_t* lock),
33 return B_TO_POSITIVE_ERROR(sReal_pthread_spin_unlock(lock));
[all...]
H A Dpthread_rwlock.cpp12 (pthread_rwlock_t *lock, const pthread_rwlockattr_t *attr),
13 return B_TO_POSITIVE_ERROR(sReal_pthread_rwlock_init(lock, attr));
17 WRAPPER_FUNCTION(int, pthread_rwlock_destroy, (pthread_rwlock_t *lock),
18 return B_TO_POSITIVE_ERROR(sReal_pthread_rwlock_destroy(lock));
22 WRAPPER_FUNCTION(int, pthread_rwlock_rdlock, (pthread_rwlock_t *lock),
23 return B_TO_POSITIVE_ERROR(sReal_pthread_rwlock_rdlock(lock));
27 WRAPPER_FUNCTION(int, pthread_rwlock_tryrdlock, (pthread_rwlock_t *lock),
28 return B_TO_POSITIVE_ERROR(sReal_pthread_rwlock_tryrdlock(lock));
33 (pthread_rwlock_t *lock, const struct timespec *timeout),
34 return B_TO_POSITIVE_ERROR(sReal_pthread_rwlock_timedrdlock(lock, timeou
[all...]
/haiku/src/system/libroot/posix/pthread/
H A Dpthread_spinlock.cpp19 pthread_spin_init(pthread_spinlock_t* lock, int pshared) argument
25 lock->lock = UNLOCKED;
31 pthread_spin_destroy(pthread_spinlock_t* lock) argument
38 pthread_spin_lock(pthread_spinlock_t* lock) argument
40 while (atomic_test_and_set((int32*)&lock->lock, LOCKED, UNLOCKED)
50 pthread_spin_trylock(pthread_spinlock_t* lock) argument
52 if (atomic_test_and_set((int32*)&lock->lock, LOCKE
59 pthread_spin_unlock(pthread_spinlock_t* lock) argument
[all...]
/haiku/headers/private/shared/
H A Dlocks.h16 int32 lock; member in struct:mutex
24 #define mutex_init(lock, name) __mutex_init(lock, name)
25 #define mutex_init_etc(lock, name, flags) __mutex_init_etc(lock, name, flags)
26 #define mutex_destroy(lock) __mutex_destroy(lock)
27 #define mutex_lock(lock) __mutex_lock(lock)
28 #define mutex_unlock(lock) __mutex_unloc
38 mutex lock; member in struct:rw_lock
70 mutex lock; member in struct:recursive_lock
109 Lock(struct mutex *lock) argument
114 Unlock(struct mutex *lock) argument
141 Lock(struct rw_lock *lock) argument
146 Unlock(struct rw_lock *lock) argument
155 Lock(struct rw_lock *lock) argument
160 Unlock(struct rw_lock *lock) argument
[all...]
/haiku/src/system/kernel/locks/
H A Dlock.cpp14 #include <lock.h>
47 recursive_lock_get_recursion(recursive_lock *lock) argument
49 if (RECURSIVE_LOCK_HOLDER(lock) == thread_get_current_thread_id())
50 return lock->recursion;
57 recursive_lock_init(recursive_lock *lock, const char *name) argument
59 recursive_lock_init_etc(lock, name, 0);
64 recursive_lock_init_etc(recursive_lock *lock, const char *name, uint32 flags) argument
66 mutex_init_etc(&lock->lock, name != NULL ? name : "recursive lock", flag
75 recursive_lock_destroy(recursive_lock *lock) argument
85 recursive_lock_lock(recursive_lock *lock) argument
109 recursive_lock_trylock(recursive_lock *lock) argument
136 recursive_lock_unlock(recursive_lock *lock) argument
259 recursive_lock* lock = (recursive_lock*)parse_expression(argv[1]); local
293 rw_lock_wait(rw_lock* lock, bool writer, InterruptsSpinLocker& locker) argument
320 rw_lock_unblock(rw_lock* lock) argument
371 rw_lock_init(rw_lock* lock, const char* name) argument
389 rw_lock_init_etc(rw_lock* lock, const char* name, uint32 flags) argument
407 rw_lock_destroy(rw_lock* lock) argument
447 _rw_lock_is_read_locked(rw_lock* lock) argument
462 _rw_lock_set_read_locked(rw_lock* lock) argument
477 _rw_lock_unset_read_locked(rw_lock* lock) argument
493 _rw_lock_read_lock(rw_lock* lock) argument
551 _rw_lock_read_lock_with_timeout(rw_lock* lock, uint32 timeoutFlags, bigtime_t timeout) argument
659 _rw_lock_read_unlock(rw_lock* lock) argument
693 rw_lock_write_lock(rw_lock* lock) argument
740 _rw_lock_write_unlock(rw_lock* lock) argument
798 rw_lock* lock = (rw_lock*)parse_expression(argv[1]); local
830 mutex_init(mutex* lock, const char *name) argument
837 mutex_init_etc(mutex* lock, const char *name, uint32 flags) argument
855 mutex_destroy(mutex* lock) argument
898 mutex_lock_threads_locked(mutex* lock, InterruptsSpinLocker* locker) argument
929 mutex_transfer_lock(mutex* lock, thread_id thread) argument
958 _mutex_lock(mutex* lock, void* _locker) argument
1022 _mutex_unlock(mutex* lock) argument
1064 _mutex_trylock(mutex* lock) argument
1082 _mutex_lock_with_timeout(mutex* lock, uint32 timeoutFlags, bigtime_t timeout) argument
1189 mutex* lock = (mutex*)parse_expression(argv[1]); local
[all...]
/haiku/src/tests/add-ons/kernel/kernelland_emu/
H A Dlock.cpp10 #include <lock.h>
46 static void _rw_lock_read_unlock_threads_locked(rw_lock* lock);
47 static void _rw_lock_write_unlock_threads_locked(rw_lock* lock);
49 static status_t _mutex_lock_threads_locked(mutex* lock);
50 static void _mutex_unlock_threads_locked(mutex* lock);
104 recursive_lock_get_recursion(recursive_lock *lock) argument
106 if (RECURSIVE_LOCK_HOLDER(lock) == find_thread(NULL))
107 return lock->recursion;
114 recursive_lock_init(recursive_lock *lock, const char *name) argument
116 mutex_init(&lock
123 recursive_lock_init_etc(recursive_lock *lock, const char *name, uint32 flags) argument
132 recursive_lock_destroy(recursive_lock *lock) argument
142 recursive_lock_lock(recursive_lock *lock) argument
159 recursive_lock_trylock(recursive_lock *lock) argument
179 recursive_lock_unlock(recursive_lock *lock) argument
197 rw_lock_wait(rw_lock* lock, bool writer) argument
226 rw_lock_unblock(rw_lock* lock) argument
275 rw_lock_init(rw_lock* lock, const char* name) argument
289 rw_lock_init_etc(rw_lock* lock, const char* name, uint32 flags) argument
303 rw_lock_destroy(rw_lock* lock) argument
343 _rw_lock_read_lock(rw_lock* lock) argument
372 _rw_lock_read_lock_with_timeout(rw_lock* lock, uint32 timeoutFlags, bigtime_t timeout) argument
462 _rw_lock_read_unlock(rw_lock* lock) argument
470 _rw_lock_read_unlock_threads_locked(rw_lock* lock) argument
495 rw_lock_write_lock(rw_lock* lock) argument
533 _rw_lock_write_unlock(rw_lock* lock) argument
541 _rw_lock_write_unlock_threads_locked(rw_lock* lock) argument
586 mutex_init(mutex* lock, const char *name) argument
600 mutex_init_etc(mutex* lock, const char *name, uint32 flags) argument
614 mutex_destroy(mutex* lock) argument
681 _mutex_lock_threads_locked(mutex* lock) argument
734 _mutex_lock(mutex* lock, void*) argument
742 _mutex_unlock_threads_locked(mutex* lock) argument
783 _mutex_unlock(mutex* lock) argument
791 _mutex_trylock(mutex* lock) argument
[all...]
H A Dsmp.cpp23 acquire_spinlock(spinlock* lock) argument
/haiku/headers/private/kernel/
H A Dsmp.h71 bool try_acquire_spinlock(spinlock* lock);
183 try_acquire_spinlock_inline(spinlock* lock) argument
185 return atomic_get_and_set(&lock->lock, 1) == 0;
190 acquire_spinlock_inline(spinlock* lock) argument
192 if (try_acquire_spinlock_inline(lock))
194 acquire_spinlock(lock);
199 release_spinlock_inline(spinlock* lock) argument
201 atomic_set(&lock->lock,
211 try_acquire_write_spinlock_inline(rw_spinlock* lock) argument
218 acquire_write_spinlock_inline(rw_spinlock* lock) argument
227 release_write_spinlock_inline(rw_spinlock* lock) argument
234 try_acquire_read_spinlock_inline(rw_spinlock* lock) argument
242 acquire_read_spinlock_inline(rw_spinlock* lock) argument
251 release_read_spinlock_inline(rw_spinlock* lock) argument
267 try_acquire_write_seqlock_inline(seqlock* lock) argument
276 acquire_write_seqlock_inline(seqlock* lock) argument
283 release_write_seqlock_inline(seqlock* lock) argument
290 acquire_read_seqlock_inline(seqlock* lock) argument
297 release_read_seqlock_inline(seqlock* lock, uint32 count) argument
[all...]
H A Dlock.h24 spinlock lock; member in struct:mutex
37 mutex lock; member in struct:recursive_lock
52 spinlock lock; member in struct:rw_lock
76 { ASSERT(find_thread(NULL) == (r)->lock.holder); }
81 extern bool _rw_lock_is_read_locked(rw_lock* lock);
115 # define RECURSIVE_LOCK_HOLDER(recursiveLock) ((recursiveLock)->lock.holder)
125 extern void recursive_lock_init(recursive_lock *lock, const char *name);
127 extern void recursive_lock_init_etc(recursive_lock *lock, const char *name,
129 extern void recursive_lock_destroy(recursive_lock *lock);
130 extern status_t recursive_lock_lock(recursive_lock *lock);
184 rw_lock_read_lock(rw_lock* lock) argument
198 rw_lock_read_lock_with_timeout(rw_lock* lock, uint32 timeoutFlags, bigtime_t timeout) argument
213 rw_lock_read_unlock(rw_lock* lock) argument
226 rw_lock_write_unlock(rw_lock* lock) argument
233 mutex_lock(mutex* lock) argument
246 mutex_trylock(mutex* lock) argument
259 mutex_lock_with_timeout(mutex* lock, uint32 timeoutFlags, bigtime_t timeout) argument
272 mutex_unlock(mutex* lock) argument
282 recursive_lock_transfer_lock(recursive_lock* lock, thread_id thread) argument
[all...]
/haiku/src/tools/fs_shell/
H A Dlock.cpp20 fssh_recursive_lock_get_recursion(fssh_recursive_lock *lock) argument
22 if (lock->holder == fssh_find_thread(NULL))
23 return lock->recursion;
30 fssh_recursive_lock_init_etc(fssh_recursive_lock *lock, const char *name, argument
35 if (lock == NULL)
39 name = "recursive lock";
41 lock->holder = -1;
42 lock->recursion = 0;
43 lock->sem = fssh_create_sem(1, name);
44 if (lock
50 fssh_recursive_lock_init(fssh_recursive_lock *lock, const char *name) argument
57 fssh_recursive_lock_destroy(fssh_recursive_lock *lock) argument
68 fssh_recursive_lock_lock(fssh_recursive_lock *lock) argument
85 fssh_recursive_lock_trylock(fssh_recursive_lock *lock) argument
103 fssh_recursive_lock_unlock(fssh_recursive_lock *lock) argument
116 fssh_recursive_lock_transfer_lock(fssh_recursive_lock *lock, fssh_thread_id thread) argument
211 fssh_rw_lock_init(fssh_rw_lock *lock, const char *name) argument
229 fssh_rw_lock_init_etc(fssh_rw_lock *lock, const char *name, uint32_t flags) argument
236 fssh_rw_lock_destroy(fssh_rw_lock *lock) argument
246 fssh_rw_lock_read_lock(fssh_rw_lock *lock) argument
258 fssh_rw_lock_read_unlock(fssh_rw_lock *lock) argument
268 fssh_rw_lock_write_lock(fssh_rw_lock *lock) argument
286 fssh_rw_lock_write_unlock(fssh_rw_lock *lock) argument
[all...]
/haiku/src/kits/locale/
H A DLocale.cpp51 BAutolock lock(fLock);
53 if (!lock.IsLocked() || !otherLock.IsLocked())
74 BAutolock lock(fLock);
75 if (!lock.IsLocked())
90 BAutolock lock(fLock);
91 if (!lock.IsLocked())
106 BAutolock lock(fLock);
107 if (!lock.IsLocked())
121 BAutolock lock(fLock);
122 if (!lock
[all...]
/haiku/src/system/libroot/posix/malloc_hoard2/
H A Darch-specific.h41 void hoardLockInit(hoardLockType &lock, const char *name);
42 void hoardLock(hoardLockType &lock);
43 void hoardUnlock(hoardLockType &lock);
/haiku/src/add-ons/kernel/file_systems/websearchfs/
H A Dlock.h13 typedef struct lock lock; typedef in typeref:struct:lock
16 struct lock { struct
25 extern _IMPEXP_KERNEL int new_lock(lock *l, const char *name);
26 extern _IMPEXP_KERNEL int free_lock(lock *l);
28 static inline status_t LOCK(lock *l)
35 static inline status_t UNLOCK(lock *l)
/haiku/src/system/kernel/
H A Dsmp.cpp117 spinlock *lock; member in struct:__anon44
128 push_lock_caller(void* caller, spinlock* lock) argument
133 sLastCaller[index].lock = lock;
138 find_lock_caller(spinlock* lock) argument
144 if (sLastCaller[index].lock == lock)
164 spinlock* lock = (spinlock*)(addr_t)address;
165 kprintf("spinlock %p:\n", lock);
166 bool locked = B_SPINLOCK_IS_LOCKED(lock);
190 update_lock_contention(spinlock* lock, bigtime_t start) argument
199 update_lock_held(spinlock* lock) argument
300 try_acquire_spinlock(spinlock* lock) argument
321 push_lock_caller(arch_debug_get_caller(), lock); local
329 acquire_spinlock(spinlock* lock) argument
371 push_lock_caller(arch_debug_get_caller(), lock); local
385 push_lock_caller(arch_debug_get_caller(), lock); local
392 acquire_spinlock_nocheck(spinlock *lock) argument
433 push_lock_caller(arch_debug_get_caller(), lock); local
447 push_lock_caller(arch_debug_get_caller(), lock); local
455 acquire_spinlock_cpu(int32 currentCPU, spinlock *lock) argument
496 push_lock_caller(arch_debug_get_caller(), lock); local
510 push_lock_caller(arch_debug_get_caller(), lock); local
517 release_spinlock(spinlock *lock) argument
549 try_acquire_write_spinlock(rw_spinlock* lock) argument
568 acquire_write_spinlock(rw_spinlock* lock) argument
598 release_write_spinlock(rw_spinlock* lock) argument
613 try_acquire_read_spinlock(rw_spinlock* lock) argument
633 acquire_read_spinlock(rw_spinlock* lock) argument
663 release_read_spinlock(rw_spinlock* lock) argument
679 try_acquire_write_seqlock(seqlock* lock) argument
689 acquire_write_seqlock(seqlock* lock) argument
697 release_write_seqlock(seqlock* lock) argument
705 acquire_read_seqlock(seqlock* lock) argument
712 release_read_seqlock(seqlock* lock, uint32 count) argument
[all...]
/haiku/src/kits/tracker/
H A DFilePanel.cpp95 AutoLock<BWindow> lock(fWindow);
96 if (!lock)
139 AutoLock<BWindow> lock(fWindow);
140 if (!lock)
151 AutoLock<BWindow> lock(fWindow);
152 if (!lock)
169 AutoLock<BWindow> lock(fWindow);
170 if (!lock)
185 AutoLock<BWindow> lock(fWindow);
186 if (!lock)
[all...]
/haiku/src/tests/system/kernel/
H A Dspinlock_contention.cpp23 vint32 lock; member in struct:dummy_spinlock
50 dummy_acquire_spinlock_nocheck(dummy_spinlock* lock) argument
54 panic("acquire_spinlock_nocheck: attempt to acquire lock %p with interrupts enabled\n", lock);
56 while (atomic_add(&lock->lock, 1) != 0) {
60 panic("acquire_spinlock_nocheck: attempt to acquire lock %p with interrupts enabled\n", lock);
61 if (atomic_set((int32 *)lock, 1) != 0)
62 panic("acquire_spinlock_nocheck: attempt to acquire lock
68 dummy_release_spinlock(dummy_spinlock* lock) argument
153 test_spinlock(dummy_spinlock* lock) argument
168 dummy_spinlock lock; local
[all...]
/haiku/headers/private/tracker/
H A DAutoLock.h43 // destructor unlock for you whenever the lock goes out of scope
46 AutoLock(T *lock, bool lockNow = true) argument
48 : fLock(lock),
55 AutoLock(T &lock, bool lockNow = true) argument
56 : fLock(&lock),
76 // for unlocking before lock goes out of scope and successive

Completed in 507 milliseconds

1234567891011>>