![]() |
SuperTinyKernel™ RTOS 1.05.3
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
#include <stk_config.h>#include <stk.h>#include <sync/stk_sync_mutex.h>#include <assert.h>#include <string.h>#include "stktest_context.h"Go to the source code of this file.
Classes | |
| class | stk::test::mutex::BasicLockUnlockTask< _AccessMode > |
| Tests basic lock/unlock functionality. More... | |
| class | stk::test::mutex::RecursiveLockTask< _AccessMode > |
| Tests recursive locking capability. More... | |
| class | stk::test::mutex::TryLockTask< _AccessMode > |
| Tests TryLock() non-blocking behavior. More... | |
| class | stk::test::mutex::TimedLockTask< _AccessMode > |
| Tests TimedLock() timeout behavior. More... | |
| class | stk::test::mutex::FIFOOrderTask< _AccessMode > |
| Tests FIFO ordering of waiting threads. More... | |
| class | stk::test::mutex::StressTestTask< _AccessMode > |
| Stress test with many lock/unlock cycles. More... | |
| class | stk::test::mutex::RecursiveDepthTask< _AccessMode > |
| Tests deep recursive locking. More... | |
| class | stk::test::mutex::InterTaskCoordinationTask< _AccessMode > |
| Tests mutex for coordinating work between tasks. More... | |
Namespaces | |
| namespace | stk |
| Namespace of STK package. | |
| namespace | stk::test |
| Namespace of the test inventory. | |
| namespace | stk::test::mutex |
| Namespace of Mutex test. | |
Macros | |
| #define | _STK_MUTEX_TEST_TASKS_MAX 5 |
| #define | _STK_MUTEX_TEST_TIMEOUT 1000 |
| #define | _STK_MUTEX_TEST_SHORT_SLEEP 10 |
| #define | _STK_MUTEX_TEST_LONG_SLEEP 100 |
| #define | _STK_MUTEX_STACK_SIZE 256 |
| #define | STK_TASK static |
Functions | |
| static void | stk::test::mutex::ResetTestState () |
| static bool | NeedsExtendedTasks (const char *test_name) |
| static bool | NeedsThreeTasks (const char *test_name) |
| template<class TaskType> | |
| static int32_t | RunTest (const char *test_name, int32_t param=0) |
| int | main (int argc, char **argv) |
Variables | |
| STK_TEST_DECL_ASSERT | |
| static volatile int32_t | stk::test::mutex::g_TestResult = 0 |
| static volatile int32_t | stk::test::mutex::g_SharedCounter = 0 |
| static volatile int32_t | stk::test::mutex::g_AcquisitionOrder [5] = {0} |
| static volatile int32_t | stk::test::mutex::g_OrderIndex = 0 |
| static volatile bool | stk::test::mutex::g_TestComplete = false |
| static volatile int32_t | stk::test::mutex::g_InstancesDone = 0 |
| static Kernel< KERNEL_DYNAMIC|KERNEL_SYNC|(STK_TICKLESS_IDLE ? KERNEL_TICKLESS :0), 5, SwitchStrategyRR, PlatformDefault > | stk::test::mutex::g_Kernel |
| static sync::Mutex | stk::test::mutex::g_TestMutex |
| #define _STK_MUTEX_STACK_SIZE 256 |
Definition at line 31 of file test_mutex.cpp.
| #define _STK_MUTEX_TEST_LONG_SLEEP 100 |
Definition at line 26 of file test_mutex.cpp.
Referenced by stk::test::mutex::RecursiveDepthTask< _AccessMode >::Run(), stk::test::mutex::TimedLockTask< _AccessMode >::Run(), and stk::test::mutex::TryLockTask< _AccessMode >::Run().
| #define _STK_MUTEX_TEST_SHORT_SLEEP 10 |
Definition at line 25 of file test_mutex.cpp.
Referenced by stk::test::mutex::BasicLockUnlockTask< _AccessMode >::Run(), stk::test::mutex::FIFOOrderTask< _AccessMode >::Run(), stk::test::mutex::InterTaskCoordinationTask< _AccessMode >::Run(), stk::test::mutex::RecursiveLockTask< _AccessMode >::Run(), stk::test::mutex::StressTestTask< _AccessMode >::Run(), stk::test::mutex::TimedLockTask< _AccessMode >::Run(), and stk::test::mutex::TryLockTask< _AccessMode >::Run().
| #define _STK_MUTEX_TEST_TASKS_MAX 5 |
Definition at line 23 of file test_mutex.cpp.
Referenced by stk::test::mutex::ResetTestState(), stk::test::mutex::BasicLockUnlockTask< _AccessMode >::Run(), stk::test::mutex::FIFOOrderTask< _AccessMode >::Run(), stk::test::mutex::InterTaskCoordinationTask< _AccessMode >::Run(), stk::test::mutex::RecursiveDepthTask< _AccessMode >::Run(), stk::test::mutex::RecursiveLockTask< _AccessMode >::Run(), and stk::test::mutex::StressTestTask< _AccessMode >::Run().
| #define _STK_MUTEX_TEST_TIMEOUT 1000 |
Definition at line 24 of file test_mutex.cpp.
| #define STK_TASK static |
Definition at line 32 of file test_mutex.cpp.
| int main | ( | int | argc, |
| char ** | argv ) |
Definition at line 588 of file test_mutex.cpp.
References stk::test::TestContext::DEFAULT_FAILURE_EXIT_CODE, stk::test::mutex::g_Kernel, RunTest(), stk::test::TestContext::ShowTestSuiteEpilogue(), stk::test::TestContext::ShowTestSuitePrologue(), and stk::test::TestContext::SUCCESS_EXIT_CODE.
|
static |
Definition at line 527 of file test_mutex.cpp.
Referenced by RunTest().
|
static |
Definition at line 537 of file test_mutex.cpp.
Referenced by RunTest().
|
static |
Definition at line 546 of file test_mutex.cpp.
References stk::test::TestContext::DEFAULT_FAILURE_EXIT_CODE, stk::test::mutex::g_Kernel, stk::test::mutex::g_TestResult, NeedsExtendedTasks(), NeedsThreeTasks(), stk::test::mutex::ResetTestState(), STK_TASK, and stk::test::TestContext::SUCCESS_EXIT_CODE.
| STK_TEST_DECL_ASSERT |
Definition at line 21 of file test_mutex.cpp.