diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-09-29 12:37:26 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-09-29 12:39:57 +0200 |
| commit | e259f732d9bf38e390588f07884c31ece95f5b7b (patch) | |
| tree | 5611af40b4266cbb8f7b42cd1dc248e0788477ca /kapi | |
| parent | 97d99228466b742133bf12e00197be9b11fcc561 (diff) | |
| download | kernel-e259f732d9bf38e390588f07884c31ece95f5b7b.tar.xz kernel-e259f732d9bf38e390588f07884c31ece95f5b7b.zip | |
kapi/interrupts: admit irq_lock dtor may panic
Diffstat (limited to 'kapi')
| -rw-r--r-- | kapi/kapi/interrupts/irq_lock.hpp | 9 |
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) |
