From e259f732d9bf38e390588f07884c31ece95f5b7b Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Tue, 29 Sep 2026 12:37:26 +0200 Subject: kapi/interrupts: admit irq_lock dtor may panic --- kapi/kapi/interrupts/irq_lock.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 { + //! 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) -- cgit v1.2.3