Rev 458 | Rev 483 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 458 | Rev 475 | ||
---|---|---|---|
Line 46... | Line 46... | ||
46 | #include <typedefs.h> |
46 | #include <typedefs.h> |
47 | #include <cpu.h> |
47 | #include <cpu.h> |
48 | #include <print.h> |
48 | #include <print.h> |
49 | #include <debug.h> |
49 | #include <debug.h> |
50 | 50 | ||
51 | volatile count_t nrdy; |
51 | atomic_t nrdy; |
52 | 52 | ||
53 | 53 | ||
54 | /** Take actions before new thread runs |
54 | /** Take actions before new thread runs |
55 | * |
55 | * |
56 | * Perform actions that need to be |
56 | * Perform actions that need to be |
Line 179... | Line 179... | ||
179 | goto retry; |
179 | goto retry; |
180 | } |
180 | } |
181 | CPU->nrdy--; |
181 | CPU->nrdy--; |
182 | spinlock_unlock(&CPU->lock); |
182 | spinlock_unlock(&CPU->lock); |
183 | 183 | ||
184 | atomic_dec((int *) &nrdy); |
184 | atomic_dec(&nrdy); |
185 | r->n--; |
185 | r->n--; |
186 | 186 | ||
187 | /* |
187 | /* |
188 | * Take the first thread from the queue. |
188 | * Take the first thread from the queue. |
189 | */ |
189 | */ |
Line 555... | Line 555... | ||
555 | goto restart; |
555 | goto restart; |
556 | } |
556 | } |
557 | cpu->nrdy--; |
557 | cpu->nrdy--; |
558 | spinlock_unlock(&cpu->lock); |
558 | spinlock_unlock(&cpu->lock); |
559 | 559 | ||
560 | atomic_dec((int *)&nrdy); |
560 | atomic_dec(&nrdy); |
561 | 561 | ||
562 | r->n--; |
562 | r->n--; |
563 | list_remove(&t->rq_link); |
563 | list_remove(&t->rq_link); |
564 | 564 | ||
565 | break; |
565 | break; |