root/Whitix/trunk/kernel/preempt.c

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
7void PreemptDisable()
8{
9        currThread->preemptCount++;
10}
11
12SYMBOL_EXPORT(PreemptDisable);
13
14void PreemptEnable()
15{
16        currThread->preemptCount--;
17       
18//      if (!currThread->preemptCount && IrqsEnabled())
19//              ThrSchedule();
20}
21
22SYMBOL_EXPORT(PreemptEnable);
23
24int PreemptCanSchedule()
25{
26        return (currThread->preemptCount == 0);
27}
Note: See TracBrowser for help on using the browser.