CardSight 0.1.0
C API reference for the CardSight firmware and application
Loading...
Searching...
No Matches
semaphore.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
9
10#ifndef CARDSIGHT_SEMAPHORE_H
11#define CARDSIGHT_SEMAPHORE_H
12
16struct semaphore {
17 void *handle;
18};
19
27void sema_init_limit(struct semaphore *sem, uint32_t initial, uint32_t limit);
36int down_timeout(struct semaphore *sem, int timeout_ms);
42void up(struct semaphore *sem);
43
44#endif /* CARDSIGHT_SEMAPHORE_H */
int down_timeout(struct semaphore *sem, int timeout_ms)
Take one count from a semaphore.
void up(struct semaphore *sem)
Add one count to a semaphore.
void sema_init_limit(struct semaphore *sem, uint32_t initial, uint32_t limit)
Initialize a counting semaphore.
A counting semaphore.
Definition semaphore.h:16
void * handle
Definition semaphore.h:17