Lines Matching refs:lock
82 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()
103 free((void *) lock); in PyThread_free_lock()
107 PyThread_acquire_lock(PyThread_type_lock lock, int waitflag) in PyThread_acquire_lock() argument
111 dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock, waitflag)); in PyThread_acquire_lock()
113 success = mutex_lock((mutex_t *) lock); in PyThread_acquire_lock()
115 success = mutex_trylock((mutex_t *) lock); in PyThread_acquire_lock()
120 dprintf(("PyThread_acquire_lock(%p, %d) -> %d\n", lock, waitflag, success)); in PyThread_acquire_lock()
125 PyThread_release_lock(PyThread_type_lock lock) in PyThread_release_lock() argument
127 dprintf(("PyThread_release_lock(%p) called\n", lock)); in PyThread_release_lock()
128 if (mutex_unlock((mutex_t *) lock)) in PyThread_release_lock()