| 74 | } |
| 75 | |
| 76 | void MutexRP::unlock() { |
| 77 | FL_ASSERT(mSpinlock != nullptr, "MutexRP::unlock() called on null mutex"); |
| 78 | FL_ASSERT(mLocked, "MutexRP::unlock() called on unlocked mutex"); |
| 79 | FL_ASSERT(mOwnerCore == get_core_num(), "MutexRP::unlock() called from different core than lock()"); |
| 80 | |
| 81 | spin_lock_t* spinlock = static_cast<spin_lock_t*>(mSpinlock); |
| 82 | |
| 83 | // Mark as unlocked |
| 84 | mLocked = false; |
| 85 | mOwnerCore = 0xFFFFFFFF; |
| 86 | |
| 87 | // Release the spinlock with interrupt state restoration (0 means enable interrupts) |
| 88 | spin_unlock(spinlock, 0); |
| 89 | } |
| 90 | |
| 91 | bool MutexRP::try_lock() { |
| 92 | if (mSpinlock == nullptr) { |
no outgoing calls
no test coverage detected