Semaphores


Overview

The Grasshopper kernel provides synchronisation support via a system of counting semaphores. These operations are used for the management of Grasshoppers' counting semaphores.

Signatures

Status sem_create(
	Capref	sem,
	int	init_value )
Create a semaphore.
Status sem_destroy(
	Capref	sem )
Destroy a semaphore.
Status sem_wait(
	Capref	sem )
Wait on a semaphore.
Status sem_signal(
	Capref	sem )
Signal a semaphore.
Status sem_poll(
	Capref	sem )
Poll a semaphore.
Status sem_queue_size(
	Capref	sem,
	int	*size )
Determine the length of a semaphore queue.