Skip to content

APCs

include/thread/apc.h View source View on GitHub
struct apc_context (1 field) source
§ struct apc *apc
struct apc (7 fields) source
§ apc_func_t func
§ void *ctx
§ struct thread *owner
§ struct apc *next
§ refcount_t refcount
§ atomic(enum apc_state) state
§ apc_destroy_t destroy
enum apc_state : uint8_t (3 variants) source
§ APC_STATE_IDLE = 0
§ APC_STATE_QUEUED
§ APC_STATE_EXECUTING
typedef void (*apc_destroy_t)(struct apc * apc)
source
struct apc * apc_create(void)
source
void apc_init(
    struct apc *cc_nonnull_ptr,
    apc_func_t cc_nonnull_ptr,
    void *arg1,
    apc_destroy_t destroy
)
source
bool apc_getref(struct apc *a)
source
void apc_putref(struct apc *cc_nonnull_ptr)
source
void apc_destroy_free(struct apc *a)
source
void apc_event_signal(struct apc_event_desc *desc)
source
bool apc_enqueue(struct thread *t, struct apc *a, enum apc_type type)
source

The caller must hold a reference to both t and a.

bool apc_cancel(struct thread *t, struct apc *a)
source

The caller must hold a reference to both t and a.

void apc_check_and_deliver(struct thread *t)
source
void apc_enable_special(void)
source
void apc_disable_special(void)
source
void apc_enable_kernel(void)
source
void apc_disable_kernel(void)
source
void apc_rundown_thread(struct thread *t)
source
bool apc_enqueue_on_curr(struct apc *a, enum apc_type type)
source
void apc_queue_init(struct apc_queue *q)
source
void apc_kernel_guard_exit(int *unused)
source
int apc_kernel_guard_enter(void)
source
void apc_special_guard_exit(int *unused)
source
int apc_special_guard_enter(void)
source
#define apc_kernel_guard()
source
Expansion
#define apc_kernel_guard() \
    cc_cleanup(apc_kernel_guard_exit) int PP_CONCAT( \
        apc_kernel_guard_, __COUNTER__) = apc_kernel_guard_enter()
#define apc_guard()
source
Expansion
#define apc_guard() apc_kernel_guard()
#define apc_special_guard()
source
Expansion
#define apc_special_guard() \
    cc_cleanup(apc_special_guard_exit) int PP_CONCAT( \
        apc_special_guard_, __COUNTER__) = apc_special_guard_enter()