mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
dpc: fix possible race
This commit is contained in:
@@ -28,12 +28,13 @@ static void isrfn(isr_t *self, context_t *context) {
|
|||||||
while (_cpu()->dpcqueue) {
|
while (_cpu()->dpcqueue) {
|
||||||
dpc_t *dpc = _cpu()->dpcqueue;
|
dpc_t *dpc = _cpu()->dpcqueue;
|
||||||
remove(dpc);
|
remove(dpc);
|
||||||
|
dpcarg_t arg = dpc->arg;
|
||||||
|
|
||||||
__assert(dpc->enqueued);
|
__assert(dpc->enqueued);
|
||||||
dpc->enqueued = false;
|
dpc->enqueued = false;
|
||||||
|
|
||||||
interrupt_set(true);
|
interrupt_set(true);
|
||||||
dpc->fn(context, dpc->arg);
|
dpc->fn(context, arg);
|
||||||
interrupt_set(false);
|
interrupt_set(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user