public class Semaphore extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Semaphore.sem_t
An opaque semaphore.
|
| Constructor and Description |
|---|
Semaphore() |
| Modifier and Type | Method and Description |
|---|---|
static int |
sem_close(Semaphore.sem_t sem)
sem_close() closes the named semaphore referred to by sem, allowing any resources that the
system has allocated to the calling process for this semaphore to be freed.
|
static Semaphore.sem_t |
SEM_FAILED()
The value returned by
Semaphore.sem_open(org.graalvm.nativeimage.c.type.CCharPointer, int, int, int) on failure. |
static Semaphore.sem_t |
sem_open(org.graalvm.nativeimage.c.type.CCharPointer name,
int oflag,
int mode,
int value)
sem_open() creates a new POSIX semaphore or opens an existing semaphore.
|
static int |
sem_post_no_transition(Semaphore.sem_t sem)
sem_post() increments (unlocks) the semaphore pointed to by sem.
|
static int |
sem_unlink(org.graalvm.nativeimage.c.type.CCharPointer name)
The named semaphore named
name is removed. |
static int |
sem_wait(Semaphore.sem_t sem)
sem_wait() decrements (locks) the semaphore pointed to by sem.
|
public static Semaphore.sem_t sem_open(org.graalvm.nativeimage.c.type.CCharPointer name, int oflag, int mode, int value)
public static Semaphore.sem_t SEM_FAILED()
Semaphore.sem_open(org.graalvm.nativeimage.c.type.CCharPointer, int, int, int) on failure.public static int sem_wait(Semaphore.sem_t sem)
public static int sem_post_no_transition(Semaphore.sem_t sem)
public static int sem_close(Semaphore.sem_t sem)
public static int sem_unlink(org.graalvm.nativeimage.c.type.CCharPointer name)
name is removed. If the semaphore is in use by other
processes, then name is immediately disassociated with the semaphore, but the
semaphore itself will not be removed until all references to it have been closed.