pub unsafe extern "C" fn rtapi_sem_new(
    key: c_int,
    module_id: c_int
) -> c_int
Expand description

‘rtapi_sem_new()’ creates a realtime semaphore. ‘key’ identifies identifies the semaphore, and must be non-zero. All modules wishing to use the same semaphore must specify the same key. ‘module_id’ is the ID of the module making the call (see rtapi_init). On success, it returns a positive integer semaphore ID, which is used for all subsequent calls dealing with the semaphore. On failure it returns a negative error code. Call only from within init/cleanup code, not from realtime tasks.