#include <kernel.h>
#include <semaphore.h>
Go to the source code of this file.
Functions | |
static semaphore | allocsem (void) |
semaphore | newsem (short count) |
Definition in file newsem.c.
static semaphore allocsem | ( | void | ) | [static] |
allocsem - allocate an unused semaphore and return its index. Scan the global semaphore table for a free entry, mark the entry used, and return the new semaphore
Definition at line 44 of file newsem.c.
References NSEM, semtab, SFREE, sentry::state, SUSED, and SYSERR.
Referenced by newsem().
semaphore newsem | ( | short | count | ) |
newsem - allocate and initialize a new semaphore.
count | - number of resources available without waiting. example: count = 1 for mutual exclusion lock |
Definition at line 20 of file newsem.c.
References allocsem(), sentry::count, disable(), restore(), semtab, and SYSERR.
Referenced by test_deltaQueue(), test_procQueue(), test_semaphore(), test_semaphore2(), test_semaphore3(), test_semaphore4(), and uartInit().