Lines Matching defs:lck

46 _lock_destroy(struct lock *lck)
48 if ((lck != NULL) && (lck->l_head != NULL)) {
49 free(lck->l_head);
50 lck->l_head = NULL;
51 lck->l_tail = NULL;
56 _lock_init(struct lock *lck, enum lock_type ltype,
60 if (lck == NULL)
62 else if ((lck->l_head = calloc_cb(1, sizeof(struct lockreq))) == NULL)
65 lck->l_type = ltype;
66 lck->l_wait = waitfunc;
67 lck->l_wakeup = wakeupfunc;
68 lck->l_head->lr_locked = 0;
69 lck->l_head->lr_watcher = NULL;
70 lck->l_head->lr_owner = NULL;
71 lck->l_head->lr_active = 1;
72 lck->l_tail = lck->l_head;
78 _lock_reinit(struct lock *lck, enum lock_type ltype,
81 if (lck == NULL)
83 else if (lck->l_head == NULL)
84 return (_lock_init(lck, ltype, waitfunc, wakeupfunc, calloc));
86 lck->l_head->lr_locked = 0;
87 lck->l_head->lr_watcher = NULL;
88 lck->l_head->lr_owner = NULL;
89 lck->l_head->lr_active = 1;
90 lck->l_tail = lck->l_head;
162 _lock_acquire(struct lock *lck, struct lockuser *lu, int prio)
174 if (lck == NULL || lu == NULL || lck->l_head == NULL)
177 if ((lck->l_type & LCK_PRIORITY) != 0) {
189 atomic_swap_ptr((void *)&lck->l_head, lu->lu_myreq,
196 if ((lck->l_wait == NULL) ||
197 ((lck->l_type & LCK_ADAPTIVE) == 0)) {
231 lck->l_wait(lck, lu);
242 _lock_release(struct lock *lck, struct lockuser *lu)
256 if ((lck == NULL) || (lu == NULL))
259 if ((lck->l_type & LCK_PRIORITY) != 0) {
266 (void *)&lck->l_tail,
295 for (lu_tmp = lck->l_tail->lr_watcher; lu_tmp != NULL;
304 if (lck->l_wakeup != NULL) {
310 lck->l_wakeup(lck,
317 if (lck->l_wakeup != NULL) {
322 lck->l_wakeup(lck, myreq->lr_watcher);
338 if (lck->l_wakeup) {
342 lck->l_wakeup(lck, myreq->lr_watcher);
352 _lock_grant(struct lock *lck __unused /* unused */, struct lockuser *lu)