2023-02-01 01:51:25 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <BAN/NoCopyMove.h>
|
|
|
|
|
|
|
|
namespace Kernel
|
|
|
|
{
|
|
|
|
|
|
|
|
class SpinLock
|
|
|
|
{
|
|
|
|
BAN_NON_COPYABLE(SpinLock);
|
|
|
|
BAN_NON_MOVABLE(SpinLock);
|
|
|
|
|
|
|
|
public:
|
|
|
|
SpinLock() = default;
|
|
|
|
void lock();
|
|
|
|
void unlock();
|
2023-02-02 15:49:30 +02:00
|
|
|
bool is_locked() const;
|
|
|
|
|
2023-02-01 01:51:25 +02:00
|
|
|
private:
|
|
|
|
int m_lock = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|