|
|
|
|
@ -32,7 +32,7 @@ Guarded Guard::enter() {
|
|
|
|
|
|
|
|
|
|
void Guard::leave() {
|
|
|
|
|
bool istate = Core::Interrupt::disable();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Epilogue next;
|
|
|
|
|
while(epilogue_queue FOR_CURRENT_CORE.consume(next)){
|
|
|
|
|
Core::Interrupt::enable();
|
|
|
|
|
@ -53,15 +53,19 @@ void Guard::relay(Epilogue handler) {
|
|
|
|
|
// handler(global_vault);
|
|
|
|
|
// leave();
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
Core::Interrupt::enable(); // goto level 0.5
|
|
|
|
|
if(epi_flag FOR_CURRENT_CORE){
|
|
|
|
|
epilogue_queue->produce(handler);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
epi_flag FOR_CURRENT_CORE = true;
|
|
|
|
|
global_lock.lock();
|
|
|
|
|
handler(global_vault);
|
|
|
|
|
leave(); // maybe not needed since destructor also calls leave
|
|
|
|
|
global_lock.unlock();
|
|
|
|
|
}
|
|
|
|
|
epilogue_queue->consume(handler);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const Vault &Guard::unsafeConstAccess() { return global_vault; }
|
|
|
|
|
|