From 9f564f6f7cfecc121e0c3859416900bfa64afd5f Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 21 Dec 2022 04:27:10 +0200 Subject: [PATCH] First unlock and then enable interrupts --- include/lock.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/lock.hpp b/include/lock.hpp index aadd805..ed23deb 100644 --- a/include/lock.hpp +++ b/include/lock.hpp @@ -60,9 +60,9 @@ public: } ~SmartLockCriticalSectionClass() { + this->LockPointer->Unlock(); if (InterruptsEnabled) CPU::Interrupts(CPU::Enable); - this->LockPointer->Unlock(); } }; /** @brief Please use this macro to create a new critical section. */