summaryrefslogtreecommitdiffstats
path: root/src/common/fiber.h
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-05-13 19:49:36 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-06-18 22:29:27 +0200
commite77ee67bfacf9a0d3b9e7cd164531a2be158adc9 (patch)
tree1fc6bba14ebfd5ab808572d8c661176b973c2cfc /src/common/fiber.h
parentCommon/Fiber: Implement Rewind on Boost Context. (diff)
downloadyuzu-e77ee67bfacf9a0d3b9e7cd164531a2be158adc9.tar
yuzu-e77ee67bfacf9a0d3b9e7cd164531a2be158adc9.tar.gz
yuzu-e77ee67bfacf9a0d3b9e7cd164531a2be158adc9.tar.bz2
yuzu-e77ee67bfacf9a0d3b9e7cd164531a2be158adc9.tar.lz
yuzu-e77ee67bfacf9a0d3b9e7cd164531a2be158adc9.tar.xz
yuzu-e77ee67bfacf9a0d3b9e7cd164531a2be158adc9.tar.zst
yuzu-e77ee67bfacf9a0d3b9e7cd164531a2be158adc9.zip
Diffstat (limited to '')
-rw-r--r--src/common/fiber.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/common/fiber.h b/src/common/fiber.h
index cab7bc4b5..dafc1100e 100644
--- a/src/common/fiber.h
+++ b/src/common/fiber.h
@@ -46,7 +46,7 @@ public:
/// Yields control from Fiber 'from' to Fiber 'to'
/// Fiber 'from' must be the currently running fiber.
- static void YieldTo(std::shared_ptr<Fiber> from, std::shared_ptr<Fiber> to);
+ static void YieldTo(std::shared_ptr<Fiber>& from, std::shared_ptr<Fiber>& to);
static std::shared_ptr<Fiber> ThreadToFiber();
void SetRewindPoint(std::function<void(void*)>&& rewind_func, void* start_parameter);
@@ -65,13 +65,13 @@ private:
Fiber();
#if defined(_WIN32) || defined(WIN32)
- void onRewind();
- void start();
+ void OnRewind();
+ void Start();
static void FiberStartFunc(void* fiber_parameter);
static void RewindStartFunc(void* fiber_parameter);
#else
- void onRewind(boost::context::detail::transfer_t& transfer);
- void start(boost::context::detail::transfer_t& transfer);
+ void OnRewind(boost::context::detail::transfer_t& transfer);
+ void Start(boost::context::detail::transfer_t& transfer);
static void FiberStartFunc(boost::context::detail::transfer_t transfer);
static void RewindStartFunc(boost::context::detail::transfer_t transfer);
#endif
@@ -79,13 +79,14 @@ private:
struct FiberImpl;
SpinLock guard{};
- std::function<void(void*)> entry_point{};
- std::function<void(void*)> rewind_point{};
+ std::function<void(void*)> entry_point;
+ std::function<void(void*)> rewind_point;
void* rewind_parameter{};
void* start_parameter{};
- std::shared_ptr<Fiber> previous_fiber{};
+ std::shared_ptr<Fiber> previous_fiber;
std::unique_ptr<FiberImpl> impl;
bool is_thread_fiber{};
+ bool released{};
};
} // namespace Common