|
Revision 1804, 414 bytes
(checked in by mwhitworth, 3 years ago)
|
|
Remove rescheduling in ThrSchedule for now (need to rethink certain parts of preemption.
|
| Line | |
|---|
| 1 | #include <preempt.h> |
|---|
| 2 | #include <sched.h> |
|---|
| 3 | #include <print.h> |
|---|
| 4 | #include <task.h> |
|---|
| 5 | #include <module.h> |
|---|
| 6 | |
|---|
| 7 | void PreemptDisable() |
|---|
| 8 | { |
|---|
| 9 | currThread->preemptCount++; |
|---|
| 10 | } |
|---|
| 11 | |
|---|
| 12 | SYMBOL_EXPORT(PreemptDisable); |
|---|
| 13 | |
|---|
| 14 | void PreemptEnable() |
|---|
| 15 | { |
|---|
| 16 | currThread->preemptCount--; |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | } |
|---|
| 21 | |
|---|
| 22 | SYMBOL_EXPORT(PreemptEnable); |
|---|
| 23 | |
|---|
| 24 | int PreemptCanSchedule() |
|---|
| 25 | { |
|---|
| 26 | return (currThread->preemptCount == 0); |
|---|
| 27 | } |
|---|