First unlock and then enable interrupts

This commit is contained in:
Alex 2022-12-21 04:27:10 +02:00
parent 985d614be2
commit 9f564f6f7c
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -60,9 +60,9 @@ public:
} }
~SmartLockCriticalSectionClass() ~SmartLockCriticalSectionClass()
{ {
this->LockPointer->Unlock();
if (InterruptsEnabled) if (InterruptsEnabled)
CPU::Interrupts(CPU::Enable); CPU::Interrupts(CPU::Enable);
this->LockPointer->Unlock();
} }
}; };
/** @brief Please use this macro to create a new critical section. */ /** @brief Please use this macro to create a new critical section. */