28#include "rtos/mbed_rtos_types.h"
29#include "rtos/internal/mbed_rtos1_types.h"
30#include "rtos/internal/mbed_rtos_storage.h"
31#include "rtos/Kernel.h"
32#include "platform/mbed_toolchain.h"
33#include "platform/NonCopyable.h"
88 MBED_DEPRECATED_SINCE(
"mbed-os-6.0.0",
"Pass a chrono duration, not an integer millisecond count. For example use `5s` rather than `5000`.")
111 MBED_DEPRECATED_SINCE("mbed-os-6.0.0", "Pass a chrono time_point, not an integer millisecond count. For example use `Kernel::Clock::now() + 5s` rather than `Kernel::
get_ms_count() + 5000`.")
143 void constructor(int32_t count, uint16_t max_count);
145#if !MBED_CONF_RTOS_PRESENT
146 static bool semaphore_available(
void *);
151 mbed_rtos_storage_semaphore_t _obj_mem;
Prevents generation of copy constructor and copy assignment operator in derived classes.
The Semaphore class is used to manage and protect access to a set of shared resources.
Semaphore(int32_t count=0)
Create and Initialize a Semaphore object used for managing resources.
bool try_acquire()
Try to acquire a Semaphore resource, and return immediately.
Semaphore(int32_t count, uint16_t max_count)
Create and Initialize a Semaphore object used for managing resources.
bool try_acquire_until(uint64_t millisec)
Wait until a Semaphore resource becomes available.
bool try_acquire_for(uint32_t millisec)
Wait until a Semaphore resource becomes available.
osStatus release(void)
Release a Semaphore resource that was obtain with Semaphore::acquire.
void acquire()
Wait until a Semaphore resource becomes available.
uint64_t get_ms_count(void)
Generic thread functions.