38 #include <sys/types.h> 49 # define PIPE_BUF (128)
A utility for storing and retrieving byte data using a ring buffer.
struct riot_pipe pipe_t
A generic pipe.
ssize_t pipe_read(pipe_t *pipe, void *buf, size_t n)
Read from a pipe.
ssize_t pipe_write(pipe_t *pipe, const void *buf, size_t n)
Write to a pipe.
thread_t * write_blocked
A thread that wants to read from this empty pipe.
thread_t holds thread's context data.
ringbuffer_t * rb
thread_t * read_blocked
A thread that wants to write to this full pipe.
void pipe_init(pipe_t *pipe, ringbuffer_t *rb, void(*free)(void *))
Initialize a pipe.
void pipe_free(pipe_t *rp)
Free a pipe.
Mutex for thread synchronization.
pipe_t * pipe_malloc(unsigned size)
Dynamically allocate a pipe with room for size bytes.
void(* free)(void *)
Function to call by pipe_free().