Flipper Zero Firmware
Loading...
Searching...
No Matches
semaphore.h File Reference

FuriSemaphore. More...

#include "base.h"
#include "thread.h"

Go to the source code of this file.

Typedefs

typedef struct FuriSemaphore FuriSemaphore
 

Functions

FuriSemaphorefuri_semaphore_alloc (uint32_t max_count, uint32_t initial_count)
 Allocate semaphore.
 
void furi_semaphore_free (FuriSemaphore *instance)
 Free semaphore.
 
FuriStatus furi_semaphore_acquire (FuriSemaphore *instance, uint32_t timeout)
 Acquire semaphore.
 
FuriStatus furi_semaphore_release (FuriSemaphore *instance)
 Release semaphore.
 
uint32_t furi_semaphore_get_count (FuriSemaphore *instance)
 Get semaphore count.
 

Detailed Description

FuriSemaphore.

Function Documentation

◆ furi_semaphore_acquire()

FuriStatus furi_semaphore_acquire ( FuriSemaphore * instance,
uint32_t timeout )

Acquire semaphore.

Parameters
instanceThe pointer to FuriSemaphore instance
[in]timeoutThe timeout
Returns
The furi status.

◆ furi_semaphore_alloc()

FuriSemaphore * furi_semaphore_alloc ( uint32_t max_count,
uint32_t initial_count )

Allocate semaphore.

Parameters
[in]max_countThe maximum count
[in]initial_countThe initial count
Returns
pointer to FuriSemaphore instance

◆ furi_semaphore_free()

void furi_semaphore_free ( FuriSemaphore * instance)

Free semaphore.

Parameters
instanceThe pointer to FuriSemaphore instance

◆ furi_semaphore_get_count()

uint32_t furi_semaphore_get_count ( FuriSemaphore * instance)

Get semaphore count.

Parameters
instanceThe pointer to FuriSemaphore instance
Returns
Semaphore count

◆ furi_semaphore_release()

FuriStatus furi_semaphore_release ( FuriSemaphore * instance)

Release semaphore.

Parameters
instanceThe pointer to FuriSemaphore instance
Returns
The furi status.