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_sync_cs.h
Go to the documentation of this file.
1/*
2 * SuperTinyKernel(TM) RTOS: Lightweight High-Performance Deterministic C++ RTOS for Embedded Systems.
3 *
4 * Source: https://github.com/SuperTinyKernel-RTOS
5 *
6 * Copyright (c) 2022-2026 Neutron Code Limited <stk@neutroncode.com>. All Rights Reserved.
7 * License: MIT License, see LICENSE for a full text.
8 */
9
10#ifndef STK_SYNC_CS_H_
11#define STK_SYNC_CS_H_
12
13#include "stk_helper.h"
14
18
19namespace stk {
20namespace sync {
21
54{
55 friend class Event;
56 friend class EventFlags;
57 friend class Mutex;
58 friend class RWMutex;
59 friend class Semaphore;
60 template <typename T, size_t N> friend class Pipe;
61
62public:
65 explicit ScopedCriticalSection() { Lock(); }
66
71
72private:
74
77};
78
79} // namespace sync
80} // namespace stk
81
82#endif /* STK_SYNC_CS_H_ */
Contains helper implementations which simplify user-side code.
Namespace of STK package.
Synchronization primitives for task coordination and resource protection.
static void Exit()
Exit a critical section.
Definition stktest.cpp:78
static void Enter()
Enter a critical section.
Definition stktest.cpp:74
Interface for mutex synchronization primitive.
Definition stk_common.h:381
ScopedCriticalSection()
Enters critical section.
Definition stk_sync_cs.h:65
void Unlock()
Unlock the mutex.
Definition stk_sync_cs.h:76
void Lock()
Lock the mutex.
Definition stk_sync_cs.h:75
~ScopedCriticalSection()
Exits critical section.
Definition stk_sync_cs.h:70
STK_NONCOPYABLE_CLASS(ScopedCriticalSection)