diff options
| author | 2020-02-10 13:33:13 -0400 | |
|---|---|---|
| committer | 2020-06-18 16:29:19 -0400 | |
| commit | 1bd706344e2381e11245b2f0bdc291429e46c634 (patch) | |
| tree | 4abae5a2088df1eb023967d83c0b808eceb30cea /src/common/fiber.cpp | |
| parent | Common: Correct fcontext fibers. (diff) | |
| download | yuzu-1bd706344e2381e11245b2f0bdc291429e46c634.tar.gz yuzu-1bd706344e2381e11245b2f0bdc291429e46c634.tar.xz yuzu-1bd706344e2381e11245b2f0bdc291429e46c634.zip | |
Common/Tests: Clang Format.
Diffstat (limited to 'src/common/fiber.cpp')
| -rw-r--r-- | src/common/fiber.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/common/fiber.cpp b/src/common/fiber.cpp index e91d86dbe..a46be73c1 100644 --- a/src/common/fiber.cpp +++ b/src/common/fiber.cpp | |||
| @@ -12,7 +12,6 @@ | |||
| 12 | 12 | ||
| 13 | namespace Common { | 13 | namespace Common { |
| 14 | 14 | ||
| 15 | |||
| 16 | #ifdef _MSC_VER | 15 | #ifdef _MSC_VER |
| 17 | 16 | ||
| 18 | struct Fiber::FiberImpl { | 17 | struct Fiber::FiberImpl { |
| @@ -27,14 +26,14 @@ void Fiber::start() { | |||
| 27 | UNREACHABLE(); | 26 | UNREACHABLE(); |
| 28 | } | 27 | } |
| 29 | 28 | ||
| 30 | void __stdcall Fiber::FiberStartFunc(void* fiber_parameter) | 29 | void __stdcall Fiber::FiberStartFunc(void* fiber_parameter) { |
| 31 | { | 30 | auto fiber = static_cast<Fiber*>(fiber_parameter); |
| 32 | auto fiber = static_cast<Fiber *>(fiber_parameter); | 31 | fiber->start(); |
| 33 | fiber->start(); | ||
| 34 | } | 32 | } |
| 35 | 33 | ||
| 36 | Fiber::Fiber(std::function<void(void*)>&& entry_point_func, void* start_parameter) | 34 | Fiber::Fiber(std::function<void(void*)>&& entry_point_func, void* start_parameter) |
| 37 | : guard{}, entry_point{std::move(entry_point_func)}, start_parameter{start_parameter}, previous_fiber{} { | 35 | : guard{}, entry_point{std::move(entry_point_func)}, start_parameter{start_parameter}, |
| 36 | previous_fiber{} { | ||
| 38 | impl = std::make_unique<FiberImpl>(); | 37 | impl = std::make_unique<FiberImpl>(); |
| 39 | impl->handle = CreateFiber(0, &FiberStartFunc, this); | 38 | impl->handle = CreateFiber(0, &FiberStartFunc, this); |
| 40 | } | 39 | } |
| @@ -99,14 +98,14 @@ void Fiber::start(boost::context::detail::transfer_t& transfer) { | |||
| 99 | UNREACHABLE(); | 98 | UNREACHABLE(); |
| 100 | } | 99 | } |
| 101 | 100 | ||
| 102 | void Fiber::FiberStartFunc(boost::context::detail::transfer_t transfer) | 101 | void Fiber::FiberStartFunc(boost::context::detail::transfer_t transfer) { |
| 103 | { | 102 | auto fiber = static_cast<Fiber*>(transfer.data); |
| 104 | auto fiber = static_cast<Fiber *>(transfer.data); | 103 | fiber->start(transfer); |
| 105 | fiber->start(transfer); | ||
| 106 | } | 104 | } |
| 107 | 105 | ||
| 108 | Fiber::Fiber(std::function<void(void*)>&& entry_point_func, void* start_parameter) | 106 | Fiber::Fiber(std::function<void(void*)>&& entry_point_func, void* start_parameter) |
| 109 | : guard{}, entry_point{std::move(entry_point_func)}, start_parameter{start_parameter}, previous_fiber{} { | 107 | : guard{}, entry_point{std::move(entry_point_func)}, start_parameter{start_parameter}, |
| 108 | previous_fiber{} { | ||
| 110 | impl = std::make_unique<FiberImpl>(); | 109 | impl = std::make_unique<FiberImpl>(); |
| 111 | impl->context = boost::context::detail::make_fcontext(impl->stack.data(), impl->stack.size(), | 110 | impl->context = boost::context::detail::make_fcontext(impl->stack.data(), impl->stack.size(), |
| 112 | FiberStartFunc); | 111 | FiberStartFunc); |