System-V Semaphore module.
More...
|
| file | semext.h |
| | System-V Semaphore module.
|
| |
System-V Semaphore module.
This module adds (very frequent!) useful operations to System-V library semaphores.
group of semext
- Author
- Miguel Oliveira e Silva
- Date
- 2026
- Version
- 1.0
◆ semup
| #define semup |
( |
|
semid, |
|
|
|
index |
|
) |
| |
Increment a semaphore (uses semop()).
- Parameters
-
| [in] | semid | [int] System-V semaphore id |
| [in] | index | [int] semaphore index in array |
◆ semdown
| #define semdown |
( |
|
semid, |
|
|
|
index |
|
) |
| |
Decrement a semaphore (uses semop()).
- Parameters
-
| [in] | semid | [int] System-V semaphore id |
| [in] | index | [int] semaphore index in array |
◆ semdown2
| #define semdown2 |
( |
|
semid, |
|
|
|
index1, |
|
|
|
index2 |
|
) |
| |
Decrements atomically two (different) semaphores in a semaphore array (uses semop()).
- Parameters
-
| [in] | semid | [int] System-V semaphore id |
| [in] | index1 | [int] semaphore index in array |
| [in] | index2 | [int] semaphore index in array |
- Precondition:
index1 != index2
◆ semupdown
| #define semupdown |
( |
|
semid, |
|
|
|
up_index, |
|
|
|
down_index |
|
) |
| |
Atomically, increment and decrement two (different) semaphores in a System V semaphore array (uses semop()).
- Parameters
-
| [in] | semid | [int] System-V semaphore id |
| [in] | up_index | [int] semaphore index in array |
| [in] | down_index | [int] semaphore index in array |
- Precondition:
up_index != down_index
◆ semsetval
| #define semsetval |
( |
|
semid, |
|
|
|
index, |
|
|
|
value |
|
) |
| |
Sets the value of the semaphore (uses semctl()).
- Parameters
-
| [in] | semid | [int] System-V semaphore id |
| [in] | index | [int] semaphore index in array |
| [in] | value | [int] desired semaphore value |