2021-11-10 05:54:44 +01:00
|
|
|
// Copyright 2021 yuzu Emulator Project
|
2021-01-30 10:40:49 +01:00
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common/common_types.h"
|
2021-11-10 05:54:44 +01:00
|
|
|
#include "core/hle/kernel/k_thread.h"
|
2021-01-30 10:40:49 +01:00
|
|
|
|
|
|
|
namespace Kernel {
|
2021-11-10 05:54:44 +01:00
|
|
|
|
2021-01-30 10:40:49 +01:00
|
|
|
class KernelCore;
|
2021-11-10 05:54:44 +01:00
|
|
|
class KLightLock;
|
2021-01-30 10:40:49 +01:00
|
|
|
|
|
|
|
class KLightConditionVariable {
|
|
|
|
public:
|
2021-06-10 19:56:35 +02:00
|
|
|
explicit KLightConditionVariable(KernelCore& kernel_) : kernel{kernel_} {}
|
2021-01-30 10:40:49 +01:00
|
|
|
|
2021-11-10 05:54:44 +01:00
|
|
|
void Wait(KLightLock* lock, s64 timeout = -1, bool allow_terminating_thread = true);
|
|
|
|
void Broadcast();
|
2021-01-30 10:40:49 +01:00
|
|
|
|
|
|
|
private:
|
2021-02-02 03:23:34 +01:00
|
|
|
KernelCore& kernel;
|
2021-06-10 19:56:35 +02:00
|
|
|
KThread::WaiterList wait_list{};
|
2021-01-30 10:40:49 +01:00
|
|
|
};
|
|
|
|
} // namespace Kernel
|