#include <stdint.h>
#include <common/list.h>
Go to the source code of this file.
◆ down()
Decrease the number of the semaphore.
- Parameters
-
sem | Pointer to the semaphore. |
- Return values
-
int | 0 on success and nonzero error number on error. |
◆ down_trylock()
The same as down(), except that if the decrement cannot be immediately performed, then call returns an error instead of blocking.
- Parameters
-
sem | Pointer to the semaphore. |
- Return values
-
int | 0 on success and nonzero error number on error. |
◆ sema_init()
void sema_init |
( |
struct semaphore * |
sem, |
|
|
int |
val |
|
) |
| |
Initialize the semaphore.
- Parameters
-
sem | Pointer to the semaphore. |
val | Initial value of the semaphore. |
- Return values
-
◆ up()
Increase the number of the semaphore.
- Parameters
-
sem | Pointer to the semaphore. |
- Return values
-
int | 0 on success and nonzero error number on error. |