summaryrefslogtreecommitdiffstats
path: root/src/common/fiber.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/fiber.h')
-rw-r--r--src/common/fiber.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/common/fiber.h b/src/common/fiber.h
index 812d6644a..89a01fdd8 100644
--- a/src/common/fiber.h
+++ b/src/common/fiber.h
@@ -18,6 +18,18 @@ namespace boost::context::detail {
namespace Common {
+/**
+ * Fiber class
+ * a fiber is a userspace thread with it's own context. They can be used to
+ * implement coroutines, emulated threading systems and certain asynchronous
+ * patterns.
+ *
+ * This class implements fibers at a low level, thus allowing greater freedom
+ * to implement such patterns. This fiber class is 'threadsafe' only one fiber
+ * can be running at a time and threads will be locked while trying to yield to
+ * a running fiber until it yields. WARNING exchanging two running fibers between
+ * threads will cause a deadlock.
+ */
class Fiber {
public:
Fiber(std::function<void(void*)>&& entry_point_func, void* start_parameter);
@@ -53,8 +65,6 @@ private:
static void FiberStartFunc(boost::context::detail::transfer_t transfer);
#endif
-
-
struct FiberImpl;
SpinLock guard;