diff options
| author | 2017-01-02 19:38:08 -0500 | |
|---|---|---|
| committer | 2017-01-04 15:58:48 -0500 | |
| commit | d3ff5b91e14356912589f9bac47fccbe79e07279 (patch) | |
| tree | e35c698d40539e360981a61b38f8fbb60aee7418 /src/core/hle/kernel/thread.h | |
| parent | Kernel/Mutex: Update a mutex priority when a thread stops waiting on it. (diff) | |
| download | yuzu-d3ff5b91e14356912589f9bac47fccbe79e07279.tar.gz yuzu-d3ff5b91e14356912589f9bac47fccbe79e07279.tar.xz yuzu-d3ff5b91e14356912589f9bac47fccbe79e07279.zip | |
Kernel/Mutex: Propagate thread priority changes to other threads inheriting the priority via mutexes
Diffstat (limited to 'src/core/hle/kernel/thread.h')
| -rw-r--r-- | src/core/hle/kernel/thread.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index f2bc1ec9c..e2f0cc831 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -90,6 +90,12 @@ public: | |||
| 90 | void SetPriority(s32 priority); | 90 | void SetPriority(s32 priority); |
| 91 | 91 | ||
| 92 | /** | 92 | /** |
| 93 | * Boost's a thread's priority to the best priority among the thread's held mutexes. | ||
| 94 | * This prevents priority inversion via priority inheritance. | ||
| 95 | */ | ||
| 96 | void UpdatePriority(); | ||
| 97 | |||
| 98 | /** | ||
| 93 | * Temporarily boosts the thread's priority until the next time it is scheduled | 99 | * Temporarily boosts the thread's priority until the next time it is scheduled |
| 94 | * @param priority The new priority | 100 | * @param priority The new priority |
| 95 | */ | 101 | */ |
| @@ -178,6 +184,9 @@ public: | |||
| 178 | /// Mutexes currently held by this thread, which will be released when it exits. | 184 | /// Mutexes currently held by this thread, which will be released when it exits. |
| 179 | boost::container::flat_set<SharedPtr<Mutex>> held_mutexes; | 185 | boost::container::flat_set<SharedPtr<Mutex>> held_mutexes; |
| 180 | 186 | ||
| 187 | /// Mutexes that this thread is currently waiting for. | ||
| 188 | boost::container::flat_set<SharedPtr<Mutex>> pending_mutexes; | ||
| 189 | |||
| 181 | SharedPtr<Process> owner_process; ///< Process that owns this thread | 190 | SharedPtr<Process> owner_process; ///< Process that owns this thread |
| 182 | 191 | ||
| 183 | /// Objects that the thread is waiting on. | 192 | /// Objects that the thread is waiting on. |