summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/thread.h')
-rw-r--r--src/core/hle/kernel/thread.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h
index 3bcf9e137..7a4916318 100644
--- a/src/core/hle/kernel/thread.h
+++ b/src/core/hle/kernel/thread.h
@@ -11,7 +11,7 @@
#include "common/common_types.h"
#include "core/arm/arm_interface.h"
#include "core/hle/kernel/object.h"
-#include "core/hle/kernel/wait_object.h"
+#include "core/hle/kernel/synchronization_object.h"
#include "core/hle/result.h"
namespace Kernel {
@@ -95,7 +95,7 @@ enum class ThreadSchedMasks : u32 {
ForcePauseMask = 0x0070,
};
-class Thread final : public WaitObject {
+class Thread final : public SynchronizationObject {
public:
explicit Thread(KernelCore& kernel);
~Thread() override;
@@ -104,11 +104,11 @@ public:
using ThreadContext = Core::ARM_Interface::ThreadContext;
- using ThreadWaitObjects = std::vector<std::shared_ptr<WaitObject>>;
+ using ThreadSynchronizationObjects = std::vector<std::shared_ptr<SynchronizationObject>>;
using WakeupCallback =
std::function<bool(ThreadWakeupReason reason, std::shared_ptr<Thread> thread,
- std::shared_ptr<WaitObject> object, std::size_t index)>;
+ std::shared_ptr<SynchronizationObject> object, std::size_t index)>;
/**
* Creates and returns a new thread. The new thread is immediately scheduled
@@ -146,6 +146,7 @@ public:
bool ShouldWait(const Thread* thread) const override;
void Acquire(Thread* thread) override;
+ bool IsSignaled() const override;
/**
* Gets the thread's current priority
@@ -233,7 +234,7 @@ public:
*
* @param object Object to query the index of.
*/
- s32 GetWaitObjectIndex(std::shared_ptr<WaitObject> object) const;
+ s32 GetSynchronizationObjectIndex(std::shared_ptr<SynchronizationObject> object) const;
/**
* Stops a thread, invalidating it from further use
@@ -314,15 +315,15 @@ public:
return owner_process;
}
- const ThreadWaitObjects& GetWaitObjects() const {
+ const ThreadSynchronizationObjects& GetSynchronizationObjects() const {
return wait_objects;
}
- void SetWaitObjects(ThreadWaitObjects objects) {
+ void SetSynchronizationObjects(ThreadSynchronizationObjects objects) {
wait_objects = std::move(objects);
}
- void ClearWaitObjects() {
+ void ClearSynchronizationObjects() {
for (const auto& waiting_object : wait_objects) {
waiting_object->RemoveWaitingThread(SharedFrom(this));
}
@@ -330,7 +331,7 @@ public:
}
/// Determines whether all the objects this thread is waiting on are ready.
- bool AllWaitObjectsReady() const;
+ bool AllSynchronizationObjectsReady() const;
const MutexWaitingThreads& GetMutexWaitingThreads() const {
return wait_mutex_threads;
@@ -395,7 +396,7 @@ public:
* will cause an assertion to trigger.
*/
bool InvokeWakeupCallback(ThreadWakeupReason reason, std::shared_ptr<Thread> thread,
- std::shared_ptr<WaitObject> object, std::size_t index);
+ std::shared_ptr<SynchronizationObject> object, std::size_t index);
u32 GetIdealCore() const {
return ideal_core;
@@ -494,7 +495,7 @@ private:
/// Objects that the thread is waiting on, in the same order as they were
/// passed to WaitSynchronization.
- ThreadWaitObjects wait_objects;
+ ThreadSynchronizationObjects wait_objects;
/// List of threads that are waiting for a mutex that is held by this thread.
MutexWaitingThreads wait_mutex_threads;