summaryrefslogtreecommitdiffstats
path: root/src/common/fiber.h
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-02-27 21:32:47 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-06-18 22:29:25 +0200
commit137d862d9b275209b3d62a413396a15e9e14b4b4 (patch)
treeb2cdf3e5ac626e5c054c1df190b9371a11d2d694 /src/common/fiber.h
parentCommon/Fiber: Additional corrections to f_context. (diff)
downloadyuzu-137d862d9b275209b3d62a413396a15e9e14b4b4.tar
yuzu-137d862d9b275209b3d62a413396a15e9e14b4b4.tar.gz
yuzu-137d862d9b275209b3d62a413396a15e9e14b4b4.tar.bz2
yuzu-137d862d9b275209b3d62a413396a15e9e14b4b4.tar.lz
yuzu-137d862d9b275209b3d62a413396a15e9e14b4b4.tar.xz
yuzu-137d862d9b275209b3d62a413396a15e9e14b4b4.tar.zst
yuzu-137d862d9b275209b3d62a413396a15e9e14b4b4.zip
Diffstat (limited to '')
-rw-r--r--src/common/fiber.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common/fiber.h b/src/common/fiber.h
index 7e3b130a4..a710df257 100644
--- a/src/common/fiber.h
+++ b/src/common/fiber.h
@@ -46,6 +46,10 @@ public:
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);
+
+ void Rewind();
+
/// Only call from main thread's fiber
void Exit();
@@ -58,8 +62,10 @@ private:
Fiber();
#if defined(_WIN32) || defined(WIN32)
+ void onRewind();
void start();
static void FiberStartFunc(void* fiber_parameter);
+ static void RewindStartFunc(void* fiber_parameter);
#else
void start(boost::context::detail::transfer_t& transfer);
static void FiberStartFunc(boost::context::detail::transfer_t transfer);
@@ -69,6 +75,8 @@ private:
SpinLock guard{};
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::unique_ptr<FiberImpl> impl;