std1.0.0-beta-7 SafeC docs

std :: sync::task

Struct std::Task

#include <std/sync/task.h> source

struct Task {
    int state;
    int resume_point;
    int blocked;
    int wait_fd;
    int wait_filter;
}

Fields

§int statesource

TASK_READY, TASK_RUNNING, or TASK_DONE

§int resume_pointsource

where to resume (0 = start)

§int blockedsource

I/O-readiness blocking (std/sched/reactor.h drives these): a task blocks itself by calling TaskScheduler::await_fd(fd, filter) from within its own function body (self.current identifies it while running) before returning its yield value. tick() then skips it entirely — no re-invocation, no busy-polling — until something calls unblock_fd() with a matching (fd, filter), normally the reactor reporting that fd became ready.

0 = runnable, 1 = blocked awaiting I/O

§int wait_fdsource

fd (or signal number) this task is waiting on

§int wait_filtersource

SCHED_READ / SCHED_WRITE / SCHED_SIGNAL (see reactor.h)