sema_post(3synch) sema_post(3synch)
NAME
sema_post - release a lock by incrementing the count value of
the semaphore
SYNOPSIS
cc [options] -Kthread file
#include <synch.h>
int sema_post(sema_t *sema);
Parameters
sema pointer to the semaphore to increment
DESCRIPTION
sema_post increments the count of the semaphore pointed to by
sema, and if the new count value is less than or equal to
zero, makes the next thread waiting at the semaphore runnable.
If more than one thread is waiting, release from the blocked
group is scheduling policy-specific for bound threads, and may
be dependent on scheduling parameters for multiplexed threads.
sema Parameter
sema must previously have been initialized, either by
sema_init or statically (see sema_init).
Return Values
sema_post returns zero for success and an error number for
failure, as described below.
Errors
If any of the following conditions is detected, sema_post
returns the corresponding value:
EINVAL Invalid argument specified.
REFERENCES
semaphore(3synch), sema_destroy(3synch), sema_init(3synch),
sema_trywait(3synch), sema_wait(3synch), synch(3synch)
Copyright 1994 Novell, Inc. Page 1