unsafe fn release(&self, token: RestoreState) {
        unsafe {
            if !token.is_reentry() {
                #[cfg(multi_core)]
                self.inner.unlock();

                #[cfg(single_core)]
                self.is_locked.set(false);

                self.lock.exit(token)
            }
        }
    }
Releases the lock.

# Safety

- This function must only be called if the lock was acquired by the
current thread.
- The caller must ensure to release the locks in the reverse order they
were acquired.
- Each release call must be paired with an acquire call.
esp-hal/src/sync.rs