Luna/kernel/include/thread/Spinlock.h

15 lines
219 B
C
Raw Normal View History

2022-09-18 18:15:19 +00:00
#pragma once
#include <stdint.h>
struct Spinlock
{
public:
void acquire();
void release();
bool locked();
private:
volatile uint64_t m_lock = 0;
};
void lock(Spinlock& lock, void (*action)(void));