Loading...
Searching...
No Matches
semaphore.h
Go to the documentation of this file.
1
5#pragma once
6
7#include "base.h"
8#include "thread.h"
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14typedef struct FuriSemaphore FuriSemaphore;
15
23FuriSemaphore* furi_semaphore_alloc(uint32_t max_count, uint32_t initial_count);
24
30
38FuriStatus furi_semaphore_acquire(FuriSemaphore* instance, uint32_t timeout);
39
46FuriStatus furi_semaphore_release(FuriSemaphore* instance);
47
54uint32_t furi_semaphore_get_count(FuriSemaphore* instance);
55
62uint32_t furi_semaphore_get_space(FuriSemaphore* instance);
63
64#ifdef __cplusplus
65}
66#endif
void furi_semaphore_free(FuriSemaphore *instance)
Free semaphore.
Definition semaphore.c:47
FuriSemaphore * furi_semaphore_alloc(uint32_t max_count, uint32_t initial_count)
Allocate semaphore.
Definition semaphore.c:23
FuriStatus furi_semaphore_release(FuriSemaphore *instance)
Release semaphore.
Definition semaphore.c:98
uint32_t furi_semaphore_get_space(FuriSemaphore *instance)
Get available space.
Definition semaphore.c:144
FuriStatus furi_semaphore_acquire(FuriSemaphore *instance, uint32_t timeout)
Acquire semaphore.
Definition semaphore.c:59
uint32_t furi_semaphore_get_count(FuriSemaphore *instance)
Get semaphore count.
Definition semaphore.c:129
Definition semaphore.c:15
Furi: Furi Thread API.