lk 418 proc.c sleep(void *chan, struct spinlock *lk) lk 425 proc.c if(lk == 0) lk 434 proc.c if(lk != &ptable.lock){ //DOC: sleeplock0 lk 436 proc.c release(lk); lk 448 proc.c if(lk != &ptable.lock){ //DOC: sleeplock2 lk 450 proc.c acquire(lk); lk 14 sleeplock.c initsleeplock(struct sleeplock *lk, char *name) lk 16 sleeplock.c initlock(&lk->lk, "sleep lock"); lk 17 sleeplock.c lk->name = name; lk 18 sleeplock.c lk->locked = 0; lk 19 sleeplock.c lk->pid = 0; lk 23 sleeplock.c acquiresleep(struct sleeplock *lk) lk 25 sleeplock.c acquire(&lk->lk); lk 26 sleeplock.c while (lk->locked) { lk 27 sleeplock.c sleep(lk, &lk->lk); lk 29 sleeplock.c lk->locked = 1; lk 30 sleeplock.c lk->pid = myproc()->pid; lk 31 sleeplock.c release(&lk->lk); lk 35 sleeplock.c releasesleep(struct sleeplock *lk) lk 37 sleeplock.c acquire(&lk->lk); lk 38 sleeplock.c lk->locked = 0; lk 39 sleeplock.c lk->pid = 0; lk 40 sleeplock.c wakeup(lk); lk 41 sleeplock.c release(&lk->lk); lk 45 sleeplock.c holdingsleep(struct sleeplock *lk) lk 49 sleeplock.c acquire(&lk->lk); lk 50 sleeplock.c r = lk->locked && (lk->pid == myproc()->pid); lk 51 sleeplock.c release(&lk->lk); lk 4 sleeplock.h struct spinlock lk; // spinlock protecting this sleep lock lk 13 spinlock.c initlock(struct spinlock *lk, char *name) lk 15 spinlock.c lk->name = name; lk 16 spinlock.c lk->locked = 0; lk 17 spinlock.c lk->cpu = 0; lk 25 spinlock.c acquire(struct spinlock *lk) lk 28 spinlock.c if(holding(lk)) lk 32 spinlock.c while(xchg(&lk->locked, 1) != 0) lk 41 spinlock.c lk->cpu = mycpu(); lk 42 spinlock.c getcallerpcs(&lk, lk->pcs); lk 47 spinlock.c release(struct spinlock *lk) lk 49 spinlock.c if(!holding(lk)) lk 52 spinlock.c lk->pcs[0] = 0; lk 53 spinlock.c lk->cpu = 0; lk 65 spinlock.c asm volatile("movl $0, %0" : "+m" (lk->locked) : );