Lines Matching refs:lock
156 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()
202 if (fastmutex_destroy((fastmutex_t *) lock) < 0) { in PyThread_free_lock()
203 dprintf(("PyThread_free_lock(%p) failed: %s\n", lock, in PyThread_free_lock()
206 free(lock); in PyThread_free_lock()
208 if (delete_semaphore((sem_id) lock) < 0) { in PyThread_free_lock()
209 dprintf(("PyThread_free_lock(%p) failed: %s\n", lock, in PyThread_free_lock()
216 int PyThread_acquire_lock(PyThread_type_lock lock, int waitflag) in PyThread_acquire_lock() argument
220 dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock, in PyThread_acquire_lock()
225 retval = fastmutex_lock((fastmutex_t *) lock); in PyThread_acquire_lock()
227 retval = fastmutex_timedlock((fastmutex_t *) lock, 0); in PyThread_acquire_lock()
230 retval = lock_semaphore((sem_id) lock); in PyThread_acquire_lock()
232 retval = lock_semaphore_x((sem_id) lock, 1, 0, 0); in PyThread_acquire_lock()
236 lock, waitflag, strerror(errno))); in PyThread_acquire_lock()
238 dprintf(("PyThread_acquire_lock(%p, %d)-> %d\n", lock, waitflag, in PyThread_acquire_lock()
244 void PyThread_release_lock(PyThread_type_lock lock) in PyThread_release_lock() argument
246 dprintf(("PyThread_release_lock(%p) called\n", lock)); in PyThread_release_lock()
249 if (fastmutex_unlock((fastmutex_t *) lock) < 0) { in PyThread_release_lock()
250 dprintf(("PyThread_release_lock(%p) failed: %s\n", lock, in PyThread_release_lock()
254 if (unlock_semaphore((sem_id) lock) < 0) { in PyThread_release_lock()
255 dprintf(("PyThread_release_lock(%p) failed: %s\n", lock, in PyThread_release_lock()