aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kapi/kapi/interrupts/irq_lock.hpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/kapi/kapi/interrupts/irq_lock.hpp b/kapi/kapi/interrupts/irq_lock.hpp
index 57c0ef7f..72a9a564 100644
--- a/kapi/kapi/interrupts/irq_lock.hpp
+++ b/kapi/kapi/interrupts/irq_lock.hpp
@@ -22,6 +22,9 @@ namespace kapi::interrupts
template<>
struct irq_lock<void>
{
+ //! Create a new IRQ lock
+ //!
+ //! This function records the creator CPU of the new lock to ensure instances are not passed across cores.
constexpr irq_lock()
: m_owner{kapi::cpu::current_id()}
{}
@@ -29,7 +32,11 @@ namespace kapi::interrupts
constexpr irq_lock(irq_lock const &) = delete;
constexpr irq_lock(irq_lock &&) = delete;
- ~irq_lock()
+ //! Destroy this IRQ lock.
+ //!
+ //! @warning This functions panics if the CPU executing is not the creator of this lock, or the lock is still
+ //! locked.
+ ~irq_lock() noexcept(false)
{
assert_owner();
if (m_locked)