libdill: Structured Concurrency for C

NAME

chmake - create a channel

SYNOPSIS

#include <libdill.h>

int chmake(size_t itemsz);

DESCRIPTION

Creates a channel. itemsz is the byte size of the items to be sent through the channel.

A channel is a synchronization primitive, not a container. It doesn't store any items.

RETURN VALUE

Returns a channel handle. In the case of an error, it returns -1 and sets errno to one of the values below.

ERRORS

EXAMPLE

int ch = chmake(sizeof(int));
if(ch == -1) {
    perror("Cannot create channel");
    exit(1);
}