summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/thread.h
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2016-12-04 04:38:14 +0100
committerSubv <subv2112@gmail.com>2016-12-04 04:38:14 +0100
commit8634b8cb83755b6c6554faa11c0e488d2ad21f90 (patch)
tree93c2e91659ccd2925210dcffb559213edbd2a64a /src/core/hle/kernel/thread.h
parentMerge pull request #2251 from JayFoxRox/remove-version (diff)
downloadyuzu-8634b8cb83755b6c6554faa11c0e488d2ad21f90.tar
yuzu-8634b8cb83755b6c6554faa11c0e488d2ad21f90.tar.gz
yuzu-8634b8cb83755b6c6554faa11c0e488d2ad21f90.tar.bz2
yuzu-8634b8cb83755b6c6554faa11c0e488d2ad21f90.tar.lz
yuzu-8634b8cb83755b6c6554faa11c0e488d2ad21f90.tar.xz
yuzu-8634b8cb83755b6c6554faa11c0e488d2ad21f90.tar.zst
yuzu-8634b8cb83755b6c6554faa11c0e488d2ad21f90.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/thread.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h
index e0ffcea8a..63b97b74f 100644
--- a/src/core/hle/kernel/thread.h
+++ b/src/core/hle/kernel/thread.h
@@ -5,6 +5,7 @@
#pragma once
#include <string>
+#include <unordered_map>
#include <vector>
#include <boost/container/flat_set.hpp>
#include "common/common_types.h"
@@ -125,6 +126,16 @@ public:
void SetWaitSynchronizationOutput(s32 output);
/**
+ * Retrieves the index that this particular object occupies in the list of objects
+ * that the thread passed to WaitSynchronizationN.
+ * It is used to set the output value of WaitSynchronizationN when the thread is awakened.
+ * @param object Object to query the index of.
+ */
+ s32 GetWaitObjectIndex(WaitObject* object) {
+ return wait_objects_index[object->GetObjectId()];
+ }
+
+ /**
* Stops a thread, invalidating it from further use
*/
void Stop();
@@ -154,16 +165,16 @@ public:
VAddr tls_address; ///< Virtual address of the Thread Local Storage of the thread
- bool waitsynch_waited; ///< Set to true if the last svcWaitSynch call caused the thread to wait
-
/// Mutexes currently held by this thread, which will be released when it exits.
boost::container::flat_set<SharedPtr<Mutex>> held_mutexes;
SharedPtr<Process> owner_process; ///< Process that owns this thread
std::vector<SharedPtr<WaitObject>> wait_objects; ///< Objects that the thread is waiting on
+ std::unordered_map<int, s32> wait_objects_index; ///< Mapping of Object ids to their position in the last waitlist that this object waited on.
+
VAddr wait_address; ///< If waiting on an AddressArbiter, this is the arbitration address
- bool wait_all; ///< True if the thread is waiting on all objects before resuming
- bool wait_set_output; ///< True if the output parameter should be set on thread wakeup
+
+ bool wait_set_output; ///< True if the WaitSynchronizationN output parameter should be set on thread wakeup
std::string name;
@@ -215,10 +226,9 @@ void WaitCurrentThread_Sleep();
* @param wait_objects Kernel objects that we are waiting on
* @param wait_set_output If true, set the output parameter on thread wakeup (for
* WaitSynchronizationN only)
- * @param wait_all If true, wait on all objects before resuming (for WaitSynchronizationN only)
*/
void WaitCurrentThread_WaitSynchronization(std::vector<SharedPtr<WaitObject>> wait_objects,
- bool wait_set_output, bool wait_all);
+ bool wait_set_output);
/**
* Waits the current thread from an ArbitrateAddress call