Function - Create a new semaphore.
kern_return_t semaphore_create (task_t task, semaphore_t *semaphore, int policy, int value);
The semaphore_create function creates a new semaphore, associates the created semaphore with the specified task, and returns a send right naming the new semaphore. In order to support a robust producer/consumer communication service, Interrupt Service Routines (ISR) must be able to signal semaphores. The semaphore synchronizer service is designed to allow user-level device drivers to perform signal operations, eliminating the need for event counters. Device drivers which utilize semaphores are responsible for creating (via semaphore_create) and exporting (via device_get_status) semaphores for user level access. Device driver semaphore creation is done at device initialization time. Device drivers may support multiple semaphores.
Functions: semaphore_destroy, semaphore_signal, semaphore_signal_all, semaphore_wait, device_get_status.