summaryrefslogblamecommitdiffstats
path: root/src/common/spin_lock.h
blob: 70282a961f1251aef5f98f386d51581685023962 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                            
                    





                                            
// Copyright 2020 yuzu Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#pragma once

#include <atomic>

namespace Common {

class SpinLock {
public:
    void lock();
    void unlock();
    bool try_lock();

private:
    std::atomic_flag lck = ATOMIC_FLAG_INIT;
};

} // namespace Common