diff options
| author | 2020-03-10 13:13:39 -0400 | |
|---|---|---|
| committer | 2020-06-27 11:35:45 -0400 | |
| commit | d494b074e8afd3aff7b65afc7b977496be06ccc9 (patch) | |
| tree | 002cc29d32a9b1e44e61fb1aae122715556b36c5 /src/core/hle/kernel/thread.h | |
| parent | CPU_Manager: Unload/Reload threads on preemption on SingleCore (diff) | |
| download | yuzu-d494b074e8afd3aff7b65afc7b977496be06ccc9.tar.gz yuzu-d494b074e8afd3aff7b65afc7b977496be06ccc9.tar.xz yuzu-d494b074e8afd3aff7b65afc7b977496be06ccc9.zip | |
Kernel: Preempt Single core on redudant yields.
Diffstat (limited to 'src/core/hle/kernel/thread.h')
| -rw-r--r-- | src/core/hle/kernel/thread.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index 953b023b5..9a29875ac 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include <functional> | 7 | #include <functional> |
| 8 | #include <string> | 8 | #include <string> |
| 9 | #include <utility> | ||
| 9 | #include <vector> | 10 | #include <vector> |
| 10 | 11 | ||
| 11 | #include "common/common_types.h" | 12 | #include "common/common_types.h" |
| @@ -503,13 +504,13 @@ public: | |||
| 503 | ResultCode Sleep(s64 nanoseconds); | 504 | ResultCode Sleep(s64 nanoseconds); |
| 504 | 505 | ||
| 505 | /// Yields this thread without rebalancing loads. | 506 | /// Yields this thread without rebalancing loads. |
| 506 | ResultCode YieldSimple(); | 507 | std::pair<ResultCode, bool> YieldSimple(); |
| 507 | 508 | ||
| 508 | /// Yields this thread and does a load rebalancing. | 509 | /// Yields this thread and does a load rebalancing. |
| 509 | ResultCode YieldAndBalanceLoad(); | 510 | std::pair<ResultCode, bool> YieldAndBalanceLoad(); |
| 510 | 511 | ||
| 511 | /// Yields this thread and if the core is left idle, loads are rebalanced | 512 | /// Yields this thread and if the core is left idle, loads are rebalanced |
| 512 | ResultCode YieldAndWaitForLoadBalancing(); | 513 | std::pair<ResultCode, bool> YieldAndWaitForLoadBalancing(); |
| 513 | 514 | ||
| 514 | void IncrementYieldCount() { | 515 | void IncrementYieldCount() { |
| 515 | yield_count++; | 516 | yield_count++; |
| @@ -587,7 +588,7 @@ private: | |||
| 587 | ThreadContext32 context_32{}; | 588 | ThreadContext32 context_32{}; |
| 588 | ThreadContext64 context_64{}; | 589 | ThreadContext64 context_64{}; |
| 589 | Common::SpinLock context_guard{}; | 590 | Common::SpinLock context_guard{}; |
| 590 | std::shared_ptr<Common::Fiber> host_context{}; | 591 | std::shared_ptr<Common::Fiber> host_context{}; |
| 591 | 592 | ||
| 592 | u64 thread_id = 0; | 593 | u64 thread_id = 0; |
| 593 | 594 | ||