Named and unnamed POSIX semaphores. Has to be linked with -lpthread
.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public, | parameter | :: | SEM_MODE | = | int(o'0660') |
Permissions. |
integer, | public, | parameter | :: | SEM_NAME_LEN | = | ID_LEN+1 |
Max. semaphore identifier length. |
Post to named or unnamed sempahore.
Increases semaphore value. Returns E_SYSTEM
on error.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sem_named_type), | intent(inout) | :: | sem |
Semaphore type. |
Increases semaphore value. Returns E_SYSTEM
on error.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sem_unnamed_type), | intent(inout), | target | :: | sem |
Semaphore type. |
Get value of named or unnamed sempahore.
Returns the current semaphore value. Returns E_SYSTEM
on error.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sem_named_type), | intent(inout) | :: | sem |
Semaphore type. |
||
integer, | intent(out) | :: | value |
Returned value. |
Returns the current semaphore value. Returns E_SYSTEM
on error.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sem_unnamed_type), | intent(inout), | target | :: | sem |
Semaphore type. |
|
integer, | intent(out) | :: | value |
Returned value. |
Wait for named or unnamed sempahore.
Waits for semaphore. Returns E_SYSTEM
on error.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sem_named_type), | intent(inout) | :: | sem |
Semaphore type. |
Waits for semaphore. Returns E_SYSTEM
on error.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sem_unnamed_type), | intent(inout), | target | :: | sem |
Semaphore type. |
Named semaphore type.
Unnamed semaphore type.
Closes named semaphore. The function returns the following error codes:
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sem_named_type), | intent(inout) | :: | sem |
Semaphore type. |
Destroys unnamed semaphore. The function returns the following error codes:
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sem_unnamed_type), | intent(inout) | :: | sem |
Semaphore type. |
Initialises unnamed semaphore. The function returns the following error codes:
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sem_unnamed_type), | intent(inout) | :: | sem |
Semaphore type. |
||
integer, | intent(in), | optional | :: | value |
Initial value. |
Opens and optionally creates named semaphore. The given name
shall not start with a leading /
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sem_named_type), | intent(inout) | :: | sem |
Semaphore type. |
||
character(len=*), | intent(in) | :: | name |
Semaphore name (without leading |
||
integer, | intent(in), | optional | :: | value |
Initial value. |
|
logical, | intent(in), | optional | :: | create |
Create semaphore. |
|
integer, | intent(in), | optional | :: | mode |
Permissions. |
Returns the name of the semaphore.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sem_named_type), | intent(inout) | :: | sem |
Semaphore type. |
Semaphore name.
Unlinks named semaphore. Returns E_SYSTEM
on error.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sem_named_type), | intent(inout) | :: | sem |
Semaphore type. |