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::test::spinlock Namespace Reference

Namespace of SpinLock test. More...

Classes

class  MutualExclusionTask
 Tests that Lock()/Unlock() provides mutual exclusion under concurrent access. More...
class  TryLockFreeTask
 Tests TryLock() succeeds immediately when the lock is free. More...
class  TryLockContendedTask
 Tests TryLock() returns false immediately when the lock is held by another task. More...
class  RecursiveLockTask
 Tests recursive Lock()/Unlock() by the same task. More...
class  RecursiveTryLockTask
 Tests TryLock() recursive acquisition by the owning task. More...
class  YieldUnderContentionTask
 Tests that Lock() yields cooperatively when spin count is exhausted. More...
class  UnlockTransferTask
 Tests that Unlock() correctly transfers the lock to a waiting contender. More...
class  StressTestTask
 Stress test mixing Lock() and TryLock() under full five-task contention. More...

Functions

static void ResetTestState ()

Variables

static volatile int32_t g_TestResult = 0
static volatile int32_t g_SharedCounter = 0
static volatile int32_t g_OrderIndex = 0
static volatile bool g_TestComplete = false
static volatile int32_t g_InstancesDone = 0
static Kernel< KERNEL_DYNAMIC, 5, SwitchStrategyRR, PlatformDefaultg_Kernel
static sync::SpinLock g_TestSpinLock

Detailed Description

Namespace of SpinLock test.

Function Documentation

◆ ResetTestState()

void stk::test::spinlock::ResetTestState ( )
static

Definition at line 511 of file test_spinlock.cpp.

512{
513 g_TestResult = 0;
514 g_SharedCounter = 0;
515 g_OrderIndex = 0;
516 g_TestComplete = false;
517 g_InstancesDone = 0;
518}
static volatile int32_t g_SharedCounter
static volatile bool g_TestComplete
static volatile int32_t g_TestResult
static volatile int32_t g_InstancesDone
static volatile int32_t g_OrderIndex

References g_InstancesDone, g_OrderIndex, g_SharedCounter, g_TestComplete, and g_TestResult.

Referenced by RunTest().

Here is the caller graph for this function:

Variable Documentation

◆ g_InstancesDone

◆ g_Kernel

Kernel<KERNEL_DYNAMIC, 5 , SwitchStrategyRR, PlatformDefault> stk::test::spinlock::g_Kernel
static

Definition at line 50 of file test_spinlock.cpp.

Referenced by main(), and RunTest().

◆ g_OrderIndex

volatile int32_t stk::test::spinlock::g_OrderIndex = 0
static

Definition at line 45 of file test_spinlock.cpp.

Referenced by ResetTestState().

◆ g_SharedCounter

◆ g_TestComplete

volatile bool stk::test::spinlock::g_TestComplete = false
static

Definition at line 46 of file test_spinlock.cpp.

Referenced by ResetTestState().

◆ g_TestResult

◆ g_TestSpinLock