Searched refs:lock (Results 1 - 25 of 705) 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
90 __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::__anon1766::__anon1767
23 spinlock lock; member in struct:mtx::__anon1766::__anon1768
/haiku/headers/private/graphics/intel_extreme/
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/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/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.c19 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/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(fssh_recursive_lock *lock, const char *name) argument
32 if (lock == NULL)
36 name = "recursive lock";
38 lock->holder = -1;
39 lock->recursion = 0;
40 lock->sem = fssh_create_sem(1, name);
41 if (lock
47 fssh_recursive_lock_destroy(fssh_recursive_lock *lock) argument
58 fssh_recursive_lock_lock(fssh_recursive_lock *lock) argument
75 fssh_recursive_lock_trylock(fssh_recursive_lock *lock) argument
93 fssh_recursive_lock_unlock(fssh_recursive_lock *lock) argument
106 fssh_recursive_lock_transfer_lock(fssh_recursive_lock *lock, fssh_thread_id thread) argument
201 fssh_rw_lock_init(fssh_rw_lock *lock, const char *name) argument
219 fssh_rw_lock_init_etc(fssh_rw_lock *lock, const char *name, uint32_t flags) argument
226 fssh_rw_lock_destroy(fssh_rw_lock *lock) argument
236 fssh_rw_lock_read_lock(fssh_rw_lock *lock) argument
248 fssh_rw_lock_read_unlock(fssh_rw_lock *lock) argument
258 fssh_rw_lock_write_lock(fssh_rw_lock *lock) argument
276 fssh_rw_lock_write_unlock(fssh_rw_lock *lock) argument
[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...]
/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 mutex_init(&lock->lock, name != NULL ? name : "recursive lock");
60 RECURSIVE_LOCK_HOLDER(lock) = -1;
61 lock
66 recursive_lock_init_etc(recursive_lock *lock, const char *name, uint32 flags) argument
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
154 rw_lock_wait(rw_lock* lock, bool writer, InterruptsSpinLocker& locker) argument
181 rw_lock_unblock(rw_lock* lock) argument
232 rw_lock_init(rw_lock* lock, const char* name) argument
250 rw_lock_init_etc(rw_lock* lock, const char* name, uint32 flags) argument
268 rw_lock_destroy(rw_lock* lock) argument
308 _rw_lock_read_lock(rw_lock* lock) argument
346 _rw_lock_read_lock_with_timeout(rw_lock* lock, uint32 timeoutFlags, bigtime_t timeout) argument
438 _rw_lock_read_unlock(rw_lock* lock) argument
466 rw_lock_write_lock(rw_lock* lock) argument
511 _rw_lock_write_unlock(rw_lock* lock) argument
564 rw_lock* lock = (rw_lock*)parse_expression(argv[1]); local
596 mutex_init(mutex* lock, const char *name) argument
603 mutex_init_etc(mutex* lock, const char *name, uint32 flags) argument
622 mutex_destroy(mutex* lock) argument
663 mutex_lock_threads_locked(mutex* lock, InterruptsSpinLocker* locker) argument
694 mutex_transfer_lock(mutex* lock, thread_id thread) argument
729 _mutex_lock(mutex* lock, void* _locker) argument
793 _mutex_unlock(mutex* lock) argument
840 _mutex_trylock(mutex* lock) argument
858 _mutex_lock_with_timeout(mutex* lock, uint32 timeoutFlags, bigtime_t timeout) argument
960 mutex* lock = (mutex*)parse_expression(argv[1]); local
[all...]
/haiku/headers/private/kernel/
H A Dsmp.h71 bool try_acquire_spinlock(spinlock* lock);
178 try_acquire_spinlock_inline(spinlock* lock) argument
180 return atomic_get_and_set((int32*)lock, 1) == 0;
185 acquire_spinlock_inline(spinlock* lock) argument
187 if (try_acquire_spinlock_inline(lock))
189 acquire_spinlock(lock);
194 release_spinlock_inline(spinlock* lock) argument
196 atomic_set((int32*)lock, 0);
200 #define try_acquire_spinlock(lock) try_acquire_spinlock_inline(lock)
206 try_acquire_write_spinlock_inline(rw_spinlock* lock) argument
213 acquire_write_spinlock_inline(rw_spinlock* lock) argument
222 release_write_spinlock_inline(rw_spinlock* lock) argument
229 try_acquire_read_spinlock_inline(rw_spinlock* lock) argument
237 acquire_read_spinlock_inline(rw_spinlock* lock) argument
246 release_read_spinlock_inline(rw_spinlock* lock) argument
262 try_acquire_write_seqlock_inline(seqlock* lock) argument
271 acquire_write_seqlock_inline(seqlock* lock) argument
278 release_write_seqlock_inline(seqlock* lock) argument
285 acquire_read_seqlock_inline(seqlock* lock) argument
292 release_read_seqlock_inline(seqlock* lock, uint32 count) argument
[all...]
H A Dlock.h24 spinlock lock; member in struct:mutex
39 mutex lock; member in struct:recursive_lock
54 spinlock lock; member in struct:rw_lock
79 { ASSERT(find_thread(NULL) == (r)->lock.holder); }
113 # define RECURSIVE_LOCK_HOLDER(recursiveLock) ((recursiveLock)->lock.holder)
123 extern void recursive_lock_init(recursive_lock *lock, const char *name);
125 extern void recursive_lock_init_etc(recursive_lock *lock, const char *name,
127 extern void recursive_lock_destroy(recursive_lock *lock);
128 extern status_t recursive_lock_lock(recursive_lock *lock);
129 extern status_t recursive_lock_trylock(recursive_lock *lock);
170 rw_lock_read_lock(rw_lock* lock) argument
184 rw_lock_read_lock_with_timeout(rw_lock* lock, uint32 timeoutFlags, bigtime_t timeout) argument
199 rw_lock_read_unlock(rw_lock* lock) argument
212 rw_lock_write_unlock(rw_lock* lock) argument
219 mutex_lock(mutex* lock) argument
232 mutex_trylock(mutex* lock) argument
245 mutex_lock_with_timeout(mutex* lock, uint32 timeoutFlags, bigtime_t timeout) argument
258 mutex_unlock(mutex* lock) argument
268 recursive_lock_transfer_lock(recursive_lock* lock, thread_id thread) argument
[all...]
/haiku/src/add-ons/kernel/file_systems/ntfs/
H A Dlock.h6 #include <lock.h>
8 typedef recursive_lock lock; typedef
/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/kernel/
H A Dsmp.cpp120 spinlock *lock; member in struct:__anon1943
131 push_lock_caller(void* caller, spinlock* lock) argument
136 sLastCaller[index].lock = lock;
141 find_lock_caller(spinlock* lock) argument
147 if (sLastCaller[index].lock == lock)
167 spinlock* lock = (spinlock*)(addr_t)address;
168 kprintf("spinlock %p:\n", lock);
169 bool locked = B_SPINLOCK_IS_LOCKED(lock);
190 spinlock *lock; member in struct:__anon1944
199 push_latency(spinlock* lock) argument
213 test_latency(spinlock* lock) argument
320 try_acquire_spinlock(spinlock* lock) argument
346 acquire_spinlock(spinlock* lock) argument
385 push_lock_caller(arch_debug_get_caller(), lock); local
397 push_lock_caller(arch_debug_get_caller(), lock); local
407 acquire_spinlock_nocheck(spinlock *lock) argument
457 push_lock_caller(arch_debug_get_caller(), lock); local
465 acquire_spinlock_cpu(int32 currentCPU, spinlock *lock) argument
515 push_lock_caller(arch_debug_get_caller(), lock); local
522 release_spinlock(spinlock *lock) argument
568 try_acquire_write_spinlock(rw_spinlock* lock) argument
587 acquire_write_spinlock(rw_spinlock* lock) argument
617 release_write_spinlock(rw_spinlock* lock) argument
632 try_acquire_read_spinlock(rw_spinlock* lock) argument
652 acquire_read_spinlock(rw_spinlock* lock) argument
682 release_read_spinlock(rw_spinlock* lock) argument
698 try_acquire_write_seqlock(seqlock* lock) argument
707 acquire_write_seqlock(seqlock* lock) argument
714 release_write_seqlock(seqlock* lock) argument
721 acquire_read_seqlock(seqlock* lock) argument
727 release_read_seqlock(seqlock* lock, uint32 count) argument
986 get_spinlock_counter(spinlock* lock) argument
[all...]
/haiku/src/add-ons/kernel/file_systems/googlefs/
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/kits/tracker/
H A DFilePanel.cpp95 AutoLock<BWindow> lock(fWindow);
96 if (!lock)
125 AutoLock<BWindow> lock(fWindow);
126 if (!lock)
137 AutoLock<BWindow> lock(fWindow);
138 if (!lock)
155 AutoLock<BWindow> lock(fWindow);
156 if (!lock)
171 AutoLock<BWindow> lock(fWindow);
172 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/src/libs/libcxxrt/
H A Dcxa_atexit.c37 static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; variable
40 pthread_mutex_lock(&lock);
43 pthread_mutex_unlock(&lock);
51 pthread_mutex_unlock(&lock);
56 pthread_mutex_lock(&lock);
67 pthread_mutex_unlock(&lock);
/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 275 milliseconds

1234567891011>>