diff options
| author | 2015-01-31 19:22:40 -0200 | |
|---|---|---|
| committer | 2015-02-02 15:37:06 -0200 | |
| commit | 4e84df8be30c5bac65e4c4e9faf07bf0fc3fb33a (patch) | |
| tree | 4e5ea0a4d5525843f41ad19530da872bc5ccda25 /src/core/hle/kernel/thread.h | |
| parent | HID: Fix crash when pressing a key when the emulator is stopped (diff) | |
| download | yuzu-4e84df8be30c5bac65e4c4e9faf07bf0fc3fb33a.tar.gz yuzu-4e84df8be30c5bac65e4c4e9faf07bf0fc3fb33a.tar.xz yuzu-4e84df8be30c5bac65e4c4e9faf07bf0fc3fb33a.zip | |
Mutex: Replace g_mutex_held_locks with a set inside Thread
Diffstat (limited to 'src/core/hle/kernel/thread.h')
| -rw-r--r-- | src/core/hle/kernel/thread.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index 9a4a00fe8..f29897ae8 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -7,6 +7,8 @@ | |||
| 7 | #include <string> | 7 | #include <string> |
| 8 | #include <vector> | 8 | #include <vector> |
| 9 | 9 | ||
| 10 | #include <boost/container/flat_set.hpp> | ||
| 11 | |||
| 10 | #include "common/common_types.h" | 12 | #include "common/common_types.h" |
| 11 | 13 | ||
| 12 | #include "core/core.h" | 14 | #include "core/core.h" |
| @@ -40,6 +42,8 @@ enum ThreadStatus { | |||
| 40 | 42 | ||
| 41 | namespace Kernel { | 43 | namespace Kernel { |
| 42 | 44 | ||
| 45 | class Mutex; | ||
| 46 | |||
| 43 | class Thread final : public WaitObject { | 47 | class Thread final : public WaitObject { |
| 44 | public: | 48 | public: |
| 45 | static ResultVal<SharedPtr<Thread>> Create(std::string name, VAddr entry_point, s32 priority, | 49 | static ResultVal<SharedPtr<Thread>> Create(std::string name, VAddr entry_point, s32 priority, |
| @@ -109,8 +113,10 @@ public: | |||
| 109 | 113 | ||
| 110 | s32 processor_id; | 114 | s32 processor_id; |
| 111 | 115 | ||
| 112 | std::vector<SharedPtr<WaitObject>> wait_objects; ///< Objects that the thread is waiting on | 116 | /// Mutexes currently held by this thread, which will be released when it exits. |
| 117 | boost::container::flat_set<SharedPtr<Mutex>> held_mutexes; | ||
| 113 | 118 | ||
| 119 | std::vector<SharedPtr<WaitObject>> wait_objects; ///< Objects that the thread is waiting on | ||
| 114 | VAddr wait_address; ///< If waiting on an AddressArbiter, this is the arbitration address | 120 | VAddr wait_address; ///< If waiting on an AddressArbiter, this is the arbitration address |
| 115 | bool wait_all; ///< True if the thread is waiting on all objects before resuming | 121 | bool wait_all; ///< True if the thread is waiting on all objects before resuming |
| 116 | bool wait_set_output; ///< True if the output parameter should be set on thread wakeup | 122 | bool wait_set_output; ///< True if the output parameter should be set on thread wakeup |
| @@ -121,7 +127,7 @@ public: | |||
| 121 | bool idle = false; | 127 | bool idle = false; |
| 122 | 128 | ||
| 123 | private: | 129 | private: |
| 124 | Thread() = default; | 130 | Thread(); |
| 125 | 131 | ||
| 126 | /// Handle used as userdata to reference this object when inserting into the CoreTiming queue. | 132 | /// Handle used as userdata to reference this object when inserting into the CoreTiming queue. |
| 127 | Handle callback_handle; | 133 | Handle callback_handle; |