diff options
| author | 2022-01-17 18:08:24 -0800 | |
|---|---|---|
| committer | 2022-01-17 18:08:24 -0800 | |
| commit | 101d86897b729ca66caf7cfee246e6f238ecf723 (patch) | |
| tree | 92b516dd4958ca01bb5544a475011a2634412132 /src/common/fiber.cpp | |
| parent | Merge pull request #7724 from ameerj/astc_new_nv (diff) | |
| parent | core: hle: kernel: KThread: Integrate with KWorkerTask and implement DoWorker... (diff) | |
| download | yuzu-101d86897b729ca66caf7cfee246e6f238ecf723.tar.gz yuzu-101d86897b729ca66caf7cfee246e6f238ecf723.tar.xz yuzu-101d86897b729ca66caf7cfee246e6f238ecf723.zip | |
Merge pull request #7712 from bunnei/fix-thread-exit
Accurately implement thread exit
Diffstat (limited to 'src/common/fiber.cpp')
| -rw-r--r-- | src/common/fiber.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/common/fiber.cpp b/src/common/fiber.cpp index 62010d762..81b212e4b 100644 --- a/src/common/fiber.cpp +++ b/src/common/fiber.cpp | |||
| @@ -124,7 +124,10 @@ void Fiber::YieldTo(std::weak_ptr<Fiber> weak_from, Fiber& to) { | |||
| 124 | 124 | ||
| 125 | // "from" might no longer be valid if the thread was killed | 125 | // "from" might no longer be valid if the thread was killed |
| 126 | if (auto from = weak_from.lock()) { | 126 | if (auto from = weak_from.lock()) { |
| 127 | ASSERT(from->impl->previous_fiber != nullptr); | 127 | if (from->impl->previous_fiber == nullptr) { |
| 128 | ASSERT_MSG(false, "previous_fiber is nullptr!"); | ||
| 129 | return; | ||
| 130 | } | ||
| 128 | from->impl->previous_fiber->impl->context = transfer.fctx; | 131 | from->impl->previous_fiber->impl->context = transfer.fctx; |
| 129 | from->impl->previous_fiber->impl->guard.unlock(); | 132 | from->impl->previous_fiber->impl->guard.unlock(); |
| 130 | from->impl->previous_fiber.reset(); | 133 | from->impl->previous_fiber.reset(); |