Zth (libzth)
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>

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 async. More...
 
class  zth::setName
 Change the name of a fiber returned by 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

 zth
 
 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). More...
 
#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). More...
 
#define zth_fiber(...)
 Prepare every given function to become a fiber by async. More...
 
#define zth_async   ::zth::fibered::
 
#define async
 Run a function as a new fiber. More...
 

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. More...
 
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. More...
 

Macro Definition Documentation

◆ zth_async

#define zth_async   ::zth::fibered::

Definition at line 787 of file async.h.

◆ zth_fiber_declare_1

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

Definition at line 726 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:163
static bool const EnableDebugPrint
Actually do print the debug output.
Definition: config.h:91
#define ZTH_STRINGIFY(x)
Converts the argument to a string literal.
Definition: util.h:32

Definition at line 740 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 750 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 751 of file async.h.

◆ ZTH_TYPEDFIBER98

#define ZTH_TYPEDFIBER98   0

Definition at line 34 of file async.h.