Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
test_sched_timeslice_and_lock.c File Reference
#include "test_sched.h"

Macros

#define THREADS_NUM   3
 
#define DURATION   K_MSEC(1)
 

Functions

 K_SEM_DEFINE (pend_sema, 0, 1)
 
 K_SEM_DEFINE (timer_sema, 0, 1)
 
static void thread_entry (void *p1, void *p2, void *p3)
 
static void setup_threads (void)
 
static void spawn_threads (int sleep_sec)
 
static void teardown_threads (void)
 
static void timer_handler (struct k_timer *timer)
 
static void thread_handler (void *p1, void *p2, void *p3)
 
void test_yield_cooperative (void)
 Validate the behavior of cooperative thread when it yields. More...
 
void test_sleep_cooperative (void)
 Validate the behavior of cooperative thread when it sleeps. More...
 
void test_busy_wait_cooperative (void)
 
void test_sleep_wakeup_preemptible (void)
 Validate k_wakeup() More...
 
static void coop_thread (void *p1, void *p2, void *p3)
 
void test_pending_thread_wakeup (void)
 Verify k_wakeup() behavior on pending thread. More...
 
void test_time_slicing_preemptible (void)
 Validate preemptive thread behavior with time slice. More...
 
void test_time_slicing_disable_preemptible (void)
 Check the behavior of preemptive thread with k_busy_wait() More...
 
void test_lock_preemptible (void)
 Lock the scheduler when preemptive threads are running. More...
 
void test_unlock_preemptible (void)
 Validate k_sched_lock() and k_sched_unlock() More...
 
void test_unlock_nested_sched_lock (void)
 Validate nested k_sched_lock() and k_sched_unlock() More...
 
void test_wakeup_expired_timer_thread (void)
 validate k_wakeup() in some corner scenario More...
 

Variables

static struct thread_data tdata [3]
 
static struct k_thread tthread [3]
 
static int old_prio
 
static int init_prio
 
struct k_thread t
 
struct k_timer timer
 
static int executed
 

Macro Definition Documentation

◆ DURATION

#define DURATION   K_MSEC(1)

◆ THREADS_NUM

#define THREADS_NUM   3

Function Documentation

◆ coop_thread()

static void coop_thread ( void p1,
void p2,
void p3 
)
static

◆ K_SEM_DEFINE() [1/2]

K_SEM_DEFINE ( pend_sema  ,
,
 
)

◆ K_SEM_DEFINE() [2/2]

K_SEM_DEFINE ( timer_sema  ,
,
 
)

◆ setup_threads()

static void setup_threads ( void  )
static

◆ spawn_threads()

static void spawn_threads ( int  sleep_sec)
static

◆ teardown_threads()

static void teardown_threads ( void  )
static

◆ test_busy_wait_cooperative()

void test_busy_wait_cooperative ( void  )

◆ thread_entry()

static void thread_entry ( void p1,
void p2,
void p3 
)
static

◆ thread_handler()

static void thread_handler ( void p1,
void p2,
void p3 
)
static

◆ timer_handler()

static void timer_handler ( struct k_timer *  timer)
static

Variable Documentation

◆ executed

int executed
static

◆ init_prio

int init_prio
static

◆ old_prio

int old_prio
static

◆ t

struct k_thread t

◆ tdata

struct thread_data tdata[3]
static

◆ timer

struct k_timer timer

◆ tthread

struct k_thread tthread[3]
static