Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
Spinlock Tests

Tests for spinlock. More...

Functions

void test_spinlock_basic (void)
 Test basic spinlock. More...
 
void test_spinlock_bounce (void)
 Test spinlock with bounce. More...
 
void test_spinlock_mutual_exclusion (void)
 Test basic mutual exclusion using interrupt masking. More...
 
void test_spinlock_no_recursive (void)
 Test spinlock cannot be recursive. More...
 
void test_spinlock_unlock_error (void)
 Test unlocking incorrect spinlock. More...
 
void test_spinlock_release_error (void)
 Test unlocking incorrect spinlock. More...
 

Detailed Description

Tests for spinlock.

Function Documentation

◆ test_spinlock_basic()

void test_spinlock_basic ( void  )

#include <tests/kernel/spinlock/src/main.c>

Test basic spinlock.

See also
k_spin_lock(), k_spin_unlock()

◆ test_spinlock_bounce()

void test_spinlock_bounce ( void  )

#include <tests/kernel/spinlock/src/main.c>

Test spinlock with bounce.

See also
arch_start_cpu()

◆ test_spinlock_mutual_exclusion()

void test_spinlock_mutual_exclusion ( void  )

#include <tests/kernel/spinlock/src/main.c>

Test basic mutual exclusion using interrupt masking.

  • Spinlocks can be initialized at run-time.
  • Spinlocks in uniprocessor context should achieve mutual exclusion using interrupt masking.
See also
k_spin_lock(), k_spin_unlock()

◆ test_spinlock_no_recursive()

void test_spinlock_no_recursive ( void  )

#include <tests/kernel/spinlock/src/spinlock_error_case.c>

Test spinlock cannot be recursive.

Validate using spinlock recursive will trigger assertion.

See also
k_spin_lock()

◆ test_spinlock_release_error()

void test_spinlock_release_error ( void  )

#include <tests/kernel/spinlock/src/spinlock_error_case.c>

Test unlocking incorrect spinlock.

Validate unlocking incorrect spinlock will trigger assertion.

See also
k_spin_release()

◆ test_spinlock_unlock_error()

void test_spinlock_unlock_error ( void  )

#include <tests/kernel/spinlock/src/spinlock_error_case.c>

Test unlocking incorrect spinlock.

Validate unlocking incorrect spinlock will trigger assertion.

See also
k_spin_unlock()