38 enum update_event_id id;
57 case UPDATE_EVENT_TIME:
62 case UPDATE_EVENT_EXIT:
63 printf(
"\n\nTime is up\n");
83 sizeof(update_eventq[0]));
111 evt->
id = UPDATE_EVENT_TIME;
125 evt->
id = UPDATE_EVENT_EXIT;
133 clock->
time += 1000000;
151 int main(
int argc,
char *argv[])
160 fprintf(stderr,
"Too many arguments - "
161 "all except '%s' will be ignored\n", argv[1]);
164 n = sscanf(argv[1],
"%d:%d",
177 fprintf(stderr,
"Cannot extract meaningful time "
178 "from '%s'\n", argv[1]);
#define containerof(ptr, type, member)
enum update_event_t::update_event_id id
#define FIBRE_VAR_INIT(fn)
Static initializer for a fibre descriptor.
void * fibre_eventq_claim(fibre_eventq_t *evtq)
Request memory resources to send an event to a fibre.
void fibre_scheduler_main_loop(void)
struct update_event_t::@5 exit
int main(int argc, char *argv[])
bool fibre_eventq_send(fibre_eventq_t *evtq, void *evtp)
Send an event to a fibre.
void fibre_eventq_release(fibre_eventq_t *evtq, void *evtp)
Release a message previously received by a fibre.
void * fibre_eventq_receive(fibre_eventq_t *evtq)
Recevied a message previously send to the fibre.
int update_handler(fibre_t *fibre)
stopwatch_fibre_t stopwatch
#define FIBRE_EVENTQ_VAR_INIT(fn, basep, base_len, msg_len)
Static initializer for a fibre and eventq descriptor.
update_event_t update_eventq[8]
int stopwatch_fibre(fibre_t *fibre)
Fibre and eventq descriptor.
unsigned int exit_after_seconds
#define PT_BEGIN_FIBRE(f)
Fibre aware alternative to PT_BEGIN().
void fibre_run(fibre_t *f)
bool fibre_timeout(uint32_t duetime)
struct update_event_t::@4 time
unsigned int exit_after_minutes