Zth (libzth)
Loading...
Searching...
No Matches
zth::passOnExit Struct Reference

Makes the fiber pass the given gate upon exit. More...

#include <async.h>

Inheritance diagram for zth::passOnExit:
zth::FiberManipulator

Public Member Functions

constexpr passOnExit (Gate &g) noexcept
 

Static Public Member Functions

static void atExit (Fiber &f, void *g) noexcept
 

Public Attributes

Gategate
 

Detailed Description

Makes the fiber pass the given gate upon exit.

Example:

void foo() { ... }
int main_fiber(int argc, char** argv) {
// If we get here, both foo()s have finished.
return 0;
}
#define zth_async
Run a function as a new fiber.
Definition async.h:1607
#define zth_fiber(...)
Prepare every given function to become a fiber by zth_async.
Definition async.h:1586
Fiber-aware barrier/gate.
Definition sync.h:1487
void wait()
Definition sync.h:1518
int main_fiber(int argc, char **argv)
Definition main.cpp:11
Makes the fiber pass the given gate upon exit.
Definition async.h:266
Gate & gate
Definition async.h:277
Examples
daemon_pattern.cpp.

Definition at line 266 of file async.h.

Constructor & Destructor Documentation

◆ passOnExit()

constexpr zth::passOnExit::passOnExit ( Gate g)
inlineexplicitconstexprnoexcept

Definition at line 268 of file async.h.

Member Function Documentation

◆ atExit()

static void zth::passOnExit::atExit ( Fiber f,
void *  g 
)
inlinestaticnoexcept

Definition at line 272 of file async.h.

Member Data Documentation

◆ gate

Gate& zth::passOnExit::gate

Definition at line 277 of file async.h.


The documentation for this struct was generated from the following file: