Zth (libzth)
Loading...
Searching...
No Matches
async.h File Reference
#include <libzth/macros.h>
#include <libzth/allocator.h>
#include <libzth/config.h>
#include <libzth/fiber.h>
#include <libzth/sync.h>
#include <libzth/util.h>
#include <libzth/worker.h>
#include <tuple>
#include <type_traits>

Go to the source code of this file.

Classes

class  zth::TypedFiber< R, F >
 
class  zth::FiberManipulator
 
class  zth::setStackSize
 Change the stack size of a fiber returned by zth_async. More...
 
class  zth::setName
 Change the name of a fiber returned by zth_async. More...
 
class  zth::passOnExit
 Makes the fiber pass the given gate upon exit. More...
 
class  zth::AutoFuture< T >
 
class  zth::TypedFiberN< R, Args >
 
class  zth::TypedFiberN< void, Args... >
 
struct  zth::TypedFiberType< F >
 
struct  zth::TypedFiberType< R(*)(Args...)>
 
struct  zth::TypedFiberType< R(*)(Args...)>::NoArg
 
class  zth::TypedFiberFactory< F >
 
struct  zth::fiber_type_impl< F >
 
struct  zth::fiber_type< F >
 
struct  zth::fiber_type< R(*)(Args...)>
 

Namespaces

namespace  zth
 
namespace  zth::fibered
 

Macros

#define ZTH_TYPEDFIBER98   0
 
#define zth_fiber_declare_1(f)
 
#define zth_fiber_declare(...)
 Do the declaration part of zth_fiber() (to be used in an .h file).
 
#define zth_fiber_define_1(storage, f)
 
#define zth_fiber_define_extern_1(f)   zth_fiber_define_1(extern, f)
 
#define zth_fiber_define_static_1(f)   zth_fiber_define_1(static constexpr, f)
 
#define zth_fiber_define(...)
 Do the definition part of zth_fiber() (to be used in a .cpp file).
 
#define zth_fiber(...)
 Prepare every given function to become a fiber by zth_async.
 
#define zth_async
 Run a function as a new fiber.
 

Functions

template<typename R , typename F >
TypedFiber< R, F > & zth::operator<< (TypedFiber< R, F > &f, FiberManipulator const &m)
 
template<typename F >
fiber_type< F >::factory zth::fiber (F f, char const *name=nullptr)
 Create a new fiber.
 
int zth_fiber_create (void(*f)(void *), void *arg=nullptr, size_t stack=0, char const *name=nullptr) noexcept
 Run a function as a new fiber.
 

Macro Definition Documentation

◆ zth_fiber_declare_1

#define zth_fiber_declare_1 (   f)
Value:
namespace zth { \
namespace fibered { \
extern ::zth::TypedFiberFactory<decltype(&::f)> const f; \
} \
}

Definition at line 767 of file async.h.

◆ zth_fiber_define_1

#define zth_fiber_define_1 (   storage,
 
)
Value:
namespace zth { \
namespace fibered { \
storage ::zth::TypedFiberFactory<decltype(&::f)> const \
? ZTH_STRINGIFY(f) "()" \
: nullptr); /* NOLINT */ \
} \
} \
typedef ::zth::TypedFiberFactory<decltype(&::f)>::AutoFuture_type f##_future;
static bool const EnablePerfEvent
Enable (but not necessarily record) perf.
Definition config.h:173
static bool const EnableDebugPrint
Actually do print the debug output.
Definition config.h:97
#define ZTH_STRINGIFY(x)
Converts the argument to a string literal.
Definition util.h:30

Definition at line 781 of file async.h.

◆ zth_fiber_define_extern_1

#define zth_fiber_define_extern_1 (   f)    zth_fiber_define_1(extern, f)

Definition at line 791 of file async.h.

◆ zth_fiber_define_static_1

#define zth_fiber_define_static_1 (   f)    zth_fiber_define_1(static constexpr, f)

Definition at line 792 of file async.h.

◆ ZTH_TYPEDFIBER98

#define ZTH_TYPEDFIBER98   0

Definition at line 32 of file async.h.