#ifndef DTACT_H
#define DTACT_H
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#define CHUNK_SIZE 32
#define LOCAL_QUEUE_CAPACITY 131072
#define LOCAL_QUEUE_HIGH_WATERMARK (LOCAL_QUEUE_CAPACITY - (LOCAL_QUEUE_CAPACITY / 8))
#define LOCAL_QUEUE_MASK (LOCAL_QUEUE_CAPACITY - 1)
#define MAILBOX_CAPACITY 65536
#define MAILBOX_MASK (MAILBOX_CAPACITY - 1)
#define WAREHOUSE_CAPACITY 32768
#define WAREHOUSE_MASK (WAREHOUSE_CAPACITY - 1)
typedef uint64_t dtact_handle_t;
typedef struct dtact_config_t {
uint32_t mWorkers;
uint8_t mSafetyLevel;
uint8_t mTopologyMode;
uint8_t mNuma;
uint32_t mFiberCapacity;
uint32_t mStackSize;
} dtact_config_t;
typedef struct dtact_spawn_options_t {
uint8_t mPriority;
uint8_t mAffinity;
uint8_t mKind;
uint8_t mSwitcher;
} dtact_spawn_options_t;
#ifdef __cplusplus
extern "C" {
#endif
void dtact_abort(void) ;
void dtact_await(dtact_handle_t aHandle) ;
struct dtact_config_t dtact_default_config(void) ;
struct dtact_spawn_options_t dtact_default_spawn_options(void) ;
dtact_handle_t dtact_fiber_launch(void (*aFunc)(void*),
void *aArg)
;
dtact_handle_t dtact_fiber_launch_ext(void (*aFunc)(void*),
void *aArg,
const struct dtact_spawn_options_t *aOptions)
;
dtact_handle_t dtact_fiber_launch_with_cleanup(void (*aFunc)(void*),
void *aArg,
void (*aCleanup)(void*))
;
dtact_handle_t dtact_fiber_launch_with_cleanup_ext(void (*aFunc)(void*),
void *aArg,
void (*aCleanup)(void*),
const struct dtact_spawn_options_t *aOptions)
;
void dtact_free_arg(void *aArg)
;
void *dtact_init(const struct dtact_config_t *aCfg) ;
void dtact_run(void *aRt) ;
void dtact_shutdown(void) ;
#ifdef __cplusplus
} #endif
#endif