librfn
An ad-hoc utility library
Functions
fibre.c File Reference
#include "librfn/fibre.h"
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "librfn/atomic.h"
#include "librfn/list.h"
#include "librfn/messageq.h"
#include "librfn/util.h"

Go to the source code of this file.

Functions

fibre_tfibre_self ()
 Returns the currently active fibre descriptor. More...
 
uint32_t fibre_scheduler_next (uint32_t time)
 Schedule the next fibre. More...
 
void fibre_init (fibre_t *f, fibre_entrypoint_t *fn)
 Dynamic initializer for a fibre descriptor. More...
 
void fibre_run (fibre_t *f)
 
bool fibre_run_atomic (fibre_t *f)
 
bool fibre_kill (fibre_t *f)
 
bool fibre_timeout (uint32_t duetime)
 
void fibre_eventq_init (fibre_eventq_t *evtq, fibre_entrypoint_t *fn, void *basep, size_t base_len, size_t msg_len)
 Dynamic initializer for a fibre and eventq descriptor. More...
 
void * fibre_eventq_claim (fibre_eventq_t *evtq)
 Request memory resources to send an event to a fibre. More...
 
bool fibre_eventq_send (fibre_eventq_t *evtq, void *evtp)
 Send an event to a fibre. More...
 
bool fibre_eventq_empty (fibre_eventq_t *evtq)
 Return true if the fibre's event queue is empty. More...
 
void * fibre_eventq_receive (fibre_eventq_t *evtq)
 Recevied a message previously send to the fibre. More...
 
void fibre_eventq_release (fibre_eventq_t *evtq, void *evtp)
 Release a message previously received by a fibre. More...
 

Variable Documentation

messageq_t atomic_runq

Definition at line 34 of file fibre.c.

fibre_t* current

Definition at line 29 of file fibre.c.

uint32_t now

Definition at line 31 of file fibre.c.

list_t runq

Definition at line 33 of file fibre.c.

Definition at line 30 of file fibre.c.

atomic_uint taint_flags

Definition at line 37 of file fibre.c.

list_t timerq

Definition at line 35 of file fibre.c.