Zephyr Project API 3.7.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
spinlock_error_case.c File Reference
#include <zephyr/ztest_test.h>
#include <zephyr/kernel.h>
#include <zephyr/ztest.h>
#include <zephyr/spinlock.h>

Functions

static void set_assert_valid (bool valid, bool unlock)
 
static void action_after_assert_fail (void)
 
void assert_post_action (const char *file, unsigned int line)
 
 ZTEST (spinlock, test_spinlock_no_recursive)
 Test spinlock cannot be recursive.
 
 ZTEST (spinlock, test_spinlock_unlock_error)
 Test unlocking incorrect spinlock.
 
 ZTEST (spinlock, test_spinlock_release_error)
 Test unlocking incorrect spinlock.
 
 ZTEST (spinlock, test_spinlock_lock_time_limit)
 Test unlocking spinlock held over the time limit.
 

Variables

static struct k_spinlock lock
 
static struct k_spinlock mylock
 
static k_spinlock_key_t key
 
static ZTEST_DMEM volatile bool valid_assert
 
static ZTEST_DMEM volatile bool unlock_after_assert
 

Function Documentation

◆ action_after_assert_fail()

static void action_after_assert_fail ( void  )
static

◆ assert_post_action()

void assert_post_action ( const char *  file,
unsigned int  line 
)

◆ set_assert_valid()

static void set_assert_valid ( bool  valid,
bool  unlock 
)
inlinestatic

Variable Documentation

◆ key

k_spinlock_key_t key
static

◆ lock

struct k_spinlock lock
static

◆ mylock

struct k_spinlock mylock
static

◆ unlock_after_assert

ZTEST_DMEM volatile bool unlock_after_assert
static

◆ valid_assert

ZTEST_DMEM volatile bool valid_assert
static