#### D.2.10.4 semaphore

Procedure from library `resources.lib` (see resources_lib).

Usage:
  semaphore(n), n int

Return:
  the index of a new semaphore initialized with n.

Example:

    LIB "resources.lib";
    int sem = semaphore(1);
    system("semaphore", "acquire", sem);
    ==> 1
    system("semaphore", "try_acquire", sem);
    ==> 0
    system("semaphore", "release", sem);
    ==> 1
    system("semaphore", "try_acquire", sem);
    ==> 1

User manual for Singular version 4-0-3, 2016, generated by texi2html.