SuperTinyKernel™ RTOS 1.05.3
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
Loading...
Searching...
No Matches
stk_c_sync.cpp File Reference
#include <cstddef>
#include <stk_config.h>
#include <stk.h>
#include <sync/stk_sync.h>
#include "stk_c.h"
Include dependency graph for stk_c_sync.cpp:

Go to the source code of this file.

Classes

struct  stk_mutex_t
struct  stk_spinlock_t
struct  stk_cv_t
struct  stk_event_t
struct  stk_sem_t
struct  stk_ef_t
struct  stk_pipe_t
struct  stk_rwmutex_t

Typedefs

typedef Pipe< stk_word_t, STK_PIPE_SIZEPipeX

Functions

void * operator new (std::size_t, void *ptr) noexcept
void operator delete (void *, void *) noexcept
stk_mutex_tstk_mutex_create (stk_mutex_mem_t *memory, uint32_t memory_size)
 Create a Mutex (using provided memory).
void stk_mutex_destroy (stk_mutex_t *mtx)
 Destroy a Mutex.
void stk_mutex_lock (stk_mutex_t *mtx)
 Lock the mutex. Blocks until available.
bool stk_mutex_trylock (stk_mutex_t *mtx)
 Try locking the mutex. Does not block if already locked.
void stk_mutex_unlock (stk_mutex_t *mtx)
 Unlock the mutex.
bool stk_mutex_timed_lock (stk_mutex_t *mtx, int32_t timeout)
 Try to lock the mutex with a timeout.
stk_spinlock_tstk_spinlock_create (stk_spinlock_mem_t *memory, uint32_t memory_size)
 Create a recursive SpinLock.
void stk_spinlock_destroy (stk_spinlock_t *lock)
 Destroy the SpinLock.
void stk_spinlock_lock (stk_spinlock_t *lock)
 Acquire the SpinLock (recursive).
bool stk_spinlock_trylock (stk_spinlock_t *lock)
 Attempt to acquire the SpinLock immediately.
void stk_spinlock_unlock (stk_spinlock_t *lock)
 Release the SpinLock.
stk_cv_tstk_cv_create (stk_cv_mem_t *memory, uint32_t memory_size)
 Create a Condition Variable (using provided memory).
void stk_cv_destroy (stk_cv_t *cv)
 Destroy a Condition Variable.
bool stk_cv_wait (stk_cv_t *cv, stk_mutex_t *mtx, int32_t timeout)
 Wait for a signal on the condition variable.
void stk_cv_notify_one (stk_cv_t *cv)
 Wake one task waiting on the condition variable.
void stk_cv_notify_all (stk_cv_t *cv)
 Wake all tasks waiting on the condition variable.
stk_event_tstk_event_create (stk_event_mem_t *memory, uint32_t memory_size, bool manual_reset)
 Create an Event (using provided memory).
void stk_event_destroy (stk_event_t *ev)
 Destroy an Event.
bool stk_event_wait (stk_event_t *ev, int32_t timeout)
 Wait for the event to become signaled.
bool stk_event_trywait (stk_event_t *ev)
 Wait for the event to become signaled.
void stk_event_set (stk_event_t *ev)
 Set the event to signaled state.
void stk_event_reset (stk_event_t *ev)
 Reset the event to non-signaled state.
void stk_event_pulse (stk_event_t *ev)
 Pulse the event (signal then immediately reset).
stk_sem_tstk_sem_create (stk_sem_mem_t *memory, uint32_t memory_size, uint32_t initial_count)
 Create a Semaphore (using provided memory).
void stk_sem_destroy (stk_sem_t *sem)
 Destroy a Semaphore.
bool stk_sem_wait (stk_sem_t *sem, int32_t timeout)
 Wait for a semaphore resource.
void stk_sem_signal (stk_sem_t *sem)
 Signal/Release a semaphore resource.
stk_ef_tstk_ef_create (stk_ef_mem_t *memory, uint32_t memory_size, uint32_t initial_flags)
 Create an EventFlags object (using provided memory).
void stk_ef_destroy (stk_ef_t *ef)
 Destroy an EventFlags object.
uint32_t stk_ef_set (stk_ef_t *ef, uint32_t flags)
 Set one or more flags.
uint32_t stk_ef_clear (stk_ef_t *ef, uint32_t flags)
 Clear one or more flags.
uint32_t stk_ef_get (stk_ef_t *ef)
 Read the current flags word without modifying it.
uint32_t stk_ef_wait (stk_ef_t *ef, uint32_t flags, uint32_t options, int32_t timeout)
 Wait for one or more flags to be set.
uint32_t stk_ef_trywait (stk_ef_t *ef, uint32_t flags, uint32_t options)
 Non-blocking flag poll.
stk_pipe_tstk_pipe_create (stk_pipe_mem_t *memory, uint32_t memory_size)
 Create a Pipe (using provided memory).
void stk_pipe_destroy (stk_pipe_t *pipe)
 Destroy a Pipe.
bool stk_pipe_write (stk_pipe_t *pipe, stk_word_t data, int32_t timeout)
 Write data to the pipe.
bool stk_pipe_read (stk_pipe_t *pipe, stk_word_t *data, int32_t timeout)
 Read data from the pipe.
size_t stk_pipe_write_bulk (stk_pipe_t *pipe, const stk_word_t *src, size_t count, int32_t timeout)
 Write multiple elements to the pipe.
size_t stk_pipe_read_bulk (stk_pipe_t *pipe, stk_word_t *dst, size_t count, int32_t timeout)
 Read multiple elements from the pipe.
size_t stk_pipe_get_size (stk_pipe_t *pipe)
 Get current number of elements in the pipe.
stk_rwmutex_tstk_rwmutex_create (stk_rwmutex_mem_t *memory, uint32_t memory_size)
 Create an RWMutex (using provided memory).
void stk_rwmutex_destroy (stk_rwmutex_t *rw)
 Destroy an RWMutex.
void stk_rwmutex_read_lock (stk_rwmutex_t *rw)
 Acquire the lock for shared reading. Blocks until available.
bool stk_rwmutex_try_read_lock (stk_rwmutex_t *rw)
 Try to acquire the read lock without blocking.
bool stk_rwmutex_timed_read_lock (stk_rwmutex_t *rw, int32_t timeout)
 Try to acquire the read lock with a timeout.
void stk_rwmutex_read_unlock (stk_rwmutex_t *rw)
 Release the shared reader lock.
void stk_rwmutex_lock (stk_rwmutex_t *rw)
 Acquire the lock for exclusive writing. Blocks until available.
bool stk_rwmutex_trylock (stk_rwmutex_t *rw)
 Try to acquire the write lock without blocking.
bool stk_rwmutex_timed_lock (stk_rwmutex_t *rw, int32_t timeout)
 Try to acquire the write lock with a timeout.
void stk_rwmutex_unlock (stk_rwmutex_t *rw)
 Release the exclusive writer lock.

Typedef Documentation

◆ PipeX

Definition at line 338 of file stk_c_sync.cpp.

Function Documentation

◆ operator delete()

void operator delete ( void * ,
void *  )
inlinenoexcept

Definition at line 21 of file stk_c_sync.cpp.

21{ /* nothing for placement delete */ }

◆ operator new()

void * operator new ( std::size_t ,
void * ptr )
inlinenoexcept

Definition at line 20 of file stk_c_sync.cpp.

20{ return ptr; }