Luna/kernel/include/thread/Spinlock.h
2022-09-18 20:15:19 +02:00

15 lines
219 B
C++

#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));