#include <libzth/macros.h>
#include <libzth/allocator.h>
#include <libzth/config.h>
#include <libzth/exception.h>
#include <libzth/fiber.h>
#include <libzth/sync.h>
#include <libzth/util.h>
#include <libzth/worker.h>
#include <initializer_list>
#include <tuple>
#include <type_traits>
Go to the source code of this file.
|
| #define | ZTH_TYPEDFIBER98 0 |
| |
| #define | REMOVE_FUNCTION_CVREF_SPECIALIZATIONS_(P, PArgs, suffix, ...) |
| |
| #define | REMOVE_FUNCTION_CVREF_SPECIALIZATIONS_A(P, suffix) |
| |
| #define | REMOVE_FUNCTION_CVREF_SPECIALIZATIONS(P, suffix) |
| |
| #define | REMOVE_FUNCTION_CVREF_MEMBER_SPECIALIZATIONS_(PArgs, cvref, ...) |
| |
| #define | REMOVE_FUNCTION_CVREF_MEMBER_SPECIALIZATIONS_A(cvref) |
| |
| #define | REMOVE_FUNCTION_CVREF_MEMBER_SPECIALIZATIONS(cvref) |
| |
| #define | REMOVE_FUNCTION_CVREF_MEMBER_SPECIALIZATIONS_CV(...) |
| |
| #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.
|
| |
|
| template<typename R > |
| TypedFiber< R > & | zth::operator<< (TypedFiber< R > &fiber, setStackSize const &m) |
| |
| template<typename R > |
| TypedFiber< R > & | zth::operator<< (TypedFiber< R > &fiber, setName const &m) |
| |
| template<typename R > |
| TypedFiber< R > & | zth::operator<< (TypedFiber< R > &fiber, setName &&m) |
| |
| template<typename R > |
| TypedFiber< R > & | zth::operator<< (TypedFiber< R > &fiber, passOnExit const &m) |
| |
| template<typename R > |
| SharedReference< typename TypedFiber< R >::Future_type > | zth::operator<< (TypedFiber< R > &fiber, asFuture const &) |
| |
| template<typename F > |
| fiber_type< F >::factory | zth::factory (F &&f, char const *name=nullptr) |
| | Create a new fiber.
|
| |
| template<typename F > |
| fiber_type< F >::factory | zth::factory (F const &f, char const *name=nullptr) |
| |
| template<typename F , typename... Args> |
| fiber_type< F >::fiber | zth::fiber (F &&f, Args &&... args) |
| | Create and start a new fiber.
|
| |
| template<typename F > |
| | zth::fiber_future (F &) -> fiber_future< typename F::factory::Return > |
| |
| template<typename F > |
| | zth::fiber_future (F const &) -> fiber_future< typename F::factory::Return > |
| |
| 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.
|
| |
◆ REMOVE_FUNCTION_CVREF_MEMBER_SPECIALIZATIONS
| #define REMOVE_FUNCTION_CVREF_MEMBER_SPECIALIZATIONS |
( |
|
cvref | ) |
|
Value:
REMOVE_FUNCTION_CVREF_MEMBER_SPECIALIZATIONS_((Args...), cvref, typename... Args)
#define REMOVE_FUNCTION_CVREF_MEMBER_SPECIALIZATIONS_A(cvref)
Definition at line 727 of file async.h.
◆ REMOVE_FUNCTION_CVREF_MEMBER_SPECIALIZATIONS_
| #define REMOVE_FUNCTION_CVREF_MEMBER_SPECIALIZATIONS_ |
( |
|
PArgs, |
|
|
|
cvref, |
|
|
|
... |
|
) |
| |
Value: template <typename R, typename C, ##__VA_ARGS__> \
struct remove_function_cvref<R(C::*) PArgs cvref> { \
typedef R(type) PArgs; \
};
Definition at line 701 of file async.h.
◆ REMOVE_FUNCTION_CVREF_MEMBER_SPECIALIZATIONS_A
| #define REMOVE_FUNCTION_CVREF_MEMBER_SPECIALIZATIONS_A |
( |
|
cvref | ) |
|
◆ REMOVE_FUNCTION_CVREF_MEMBER_SPECIALIZATIONS_CV
| #define REMOVE_FUNCTION_CVREF_MEMBER_SPECIALIZATIONS_CV |
( |
|
... | ) |
|
Value:
REMOVE_FUNCTION_CVREF_MEMBER_SPECIALIZATIONS(const __VA_ARGS__) \
REMOVE_FUNCTION_CVREF_MEMBER_SPECIALIZATIONS(volatile __VA_ARGS__) \
REMOVE_FUNCTION_CVREF_MEMBER_SPECIALIZATIONS(const volatile __VA_ARGS__)
#define REMOVE_FUNCTION_CVREF_MEMBER_SPECIALIZATIONS(cvref)
Definition at line 735 of file async.h.
◆ REMOVE_FUNCTION_CVREF_SPECIALIZATIONS
| #define REMOVE_FUNCTION_CVREF_SPECIALIZATIONS |
( |
|
P, |
|
|
|
suffix |
|
) |
| |
Value:
REMOVE_FUNCTION_CVREF_SPECIALIZATIONS_(P, (Args...), suffix, typename... Args)
#define REMOVE_FUNCTION_CVREF_SPECIALIZATIONS_A(P, suffix)
Definition at line 673 of file async.h.
◆ REMOVE_FUNCTION_CVREF_SPECIALIZATIONS_
| #define REMOVE_FUNCTION_CVREF_SPECIALIZATIONS_ |
( |
|
P, |
|
|
|
PArgs, |
|
|
|
suffix, |
|
|
|
... |
|
) |
| |
Value: template <typename R, ##__VA_ARGS__> \
struct remove_function_cvref<R P PArgs suffix> { \
typedef R(type) PArgs; \
};
Definition at line 646 of file async.h.
◆ REMOVE_FUNCTION_CVREF_SPECIALIZATIONS_A
| #define REMOVE_FUNCTION_CVREF_SPECIALIZATIONS_A |
( |
|
P, |
|
|
|
suffix |
|
) |
| |
◆ zth_async
Run a function as a new fiber.
The function must have passed through zth_fiber() (or friends) first. Example:
void foo(int i) { ... }
return 0;
}
#define zth_async
Run a function as a new fiber.
#define zth_fiber(...)
Prepare every given function to become a fiber by zth_async.
int main_fiber(int argc, char **argv)
Definition at line 1607 of file async.h.
◆ zth_fiber
Prepare every given function to become a fiber by zth_async.
Definition at line 1586 of file async.h.
◆ zth_fiber_declare
| #define zth_fiber_declare |
( |
|
... | ) |
|
◆ zth_fiber_declare_1
| #define zth_fiber_declare_1 |
( |
|
f | ) |
|
Value:
namespace fibered { \
extern ::zth::fiber_type<
decltype(&::f)>
::factory const f; \
} \
}
fiber_type< F >::factory factory(F &&f, char const *name=nullptr)
Create a new fiber.
Definition at line 1549 of file async.h.
◆ zth_fiber_define
| #define zth_fiber_define |
( |
|
... | ) |
|
◆ zth_fiber_define_1
| #define zth_fiber_define_1 |
( |
|
storage, |
|
|
|
f |
|
) |
| |
Value:
namespace fibered { \
ZTH_DEPRECATED("Use zth::fiber(f, args...) instead") \
storage ::zth::fiber_type<
decltype(&::f)>
::factory const \
: nullptr); \
} \
} \
static bool const EnablePerfEvent
Enable (but not necessarily record) perf.
static bool const EnableDebugPrint
Actually do print the debug output.
#define ZTH_STRINGIFY(x)
Converts the argument to a string literal.
Definition at line 1562 of file async.h.
◆ zth_fiber_define_extern_1
◆ zth_fiber_define_static_1
◆ ZTH_TYPEDFIBER98
| #define ZTH_TYPEDFIBER98 0 |