2021-02-09 03:02:36 +01:00
|
|
|
// Copyright 2021 yuzu Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include "core/hle/kernel/k_spin_lock.h"
|
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
|
|
|
void KSpinLock::Lock() {
|
2022-04-08 01:01:26 +02:00
|
|
|
lck.lock();
|
2021-02-09 03:02:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void KSpinLock::Unlock() {
|
2022-04-08 01:01:26 +02:00
|
|
|
lck.unlock();
|
2021-02-09 03:02:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bool KSpinLock::TryLock() {
|
2022-04-08 01:01:26 +02:00
|
|
|
return lck.try_lock();
|
2021-02-09 03:02:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Kernel
|