lk 548 kernel/proc.c sleep(void *chan, struct spinlock *lk) lk 560 kernel/proc.c release(lk); lk 573 kernel/proc.c acquire(lk); lk 13 kernel/sleeplock.c initsleeplock(struct sleeplock *lk, char *name) lk 15 kernel/sleeplock.c initlock(&lk->lk, "sleep lock"); lk 16 kernel/sleeplock.c lk->name = name; lk 17 kernel/sleeplock.c lk->locked = 0; lk 18 kernel/sleeplock.c lk->pid = 0; lk 22 kernel/sleeplock.c acquiresleep(struct sleeplock *lk) lk 24 kernel/sleeplock.c acquire(&lk->lk); lk 25 kernel/sleeplock.c while (lk->locked) { lk 26 kernel/sleeplock.c sleep(lk, &lk->lk); lk 28 kernel/sleeplock.c lk->locked = 1; lk 29 kernel/sleeplock.c lk->pid = myproc()->pid; lk 30 kernel/sleeplock.c release(&lk->lk); lk 34 kernel/sleeplock.c releasesleep(struct sleeplock *lk) lk 36 kernel/sleeplock.c acquire(&lk->lk); lk 37 kernel/sleeplock.c lk->locked = 0; lk 38 kernel/sleeplock.c lk->pid = 0; lk 39 kernel/sleeplock.c wakeup(lk); lk 40 kernel/sleeplock.c release(&lk->lk); lk 44 kernel/sleeplock.c holdingsleep(struct sleeplock *lk) lk 48 kernel/sleeplock.c acquire(&lk->lk); lk 49 kernel/sleeplock.c r = lk->locked && (lk->pid == myproc()->pid); lk 50 kernel/sleeplock.c release(&lk->lk); lk 4 kernel/sleeplock.h struct spinlock lk; // spinlock protecting this sleep lock lk 12 kernel/spinlock.c initlock(struct spinlock *lk, char *name) lk 14 kernel/spinlock.c lk->name = name; lk 15 kernel/spinlock.c lk->locked = 0; lk 16 kernel/spinlock.c lk->cpu = 0; lk 22 kernel/spinlock.c acquire(struct spinlock *lk) lk 25 kernel/spinlock.c if(holding(lk)) lk 32 kernel/spinlock.c while(__sync_lock_test_and_set(&lk->locked, 1) != 0) lk 42 kernel/spinlock.c lk->cpu = mycpu(); lk 47 kernel/spinlock.c release(struct spinlock *lk) lk 49 kernel/spinlock.c if(!holding(lk)) lk 52 kernel/spinlock.c lk->cpu = 0; lk 69 kernel/spinlock.c __sync_lock_release(&lk->locked); lk 77 kernel/spinlock.c holding(struct spinlock *lk) lk 80 kernel/spinlock.c r = (lk->locked && lk->cpu == mycpu());