Zephyr Project API 3.7.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Semaphore

Functions

 ZTEST_USER (kernel_sys_sem, test_multiple_thread_sem_usage)
 Test semaphore usage with multiple thread.
 
 ZTEST_USER (kernel_sys_sem, test_multi_thread_sem_limit)
 Test max semaphore can be give and take with multiple thread.
 

Detailed Description

Function Documentation

◆ ZTEST_USER() [1/2]

ZTEST_USER ( kernel_sys_sem  ,
test_multi_thread_sem_limit   
)

#include <tests/kernel/semaphore/sys_sem/src/main.c>

Test max semaphore can be give and take with multiple thread.

  • Define and initialize semaphore and thread.
  • Give sem by multiple threads.
  • Verify more than max count about semaphore can reach.
  • Take sem by multiple threads and verify if sem count is correct.

◆ ZTEST_USER() [2/2]

ZTEST_USER ( kernel_sys_sem  ,
test_multiple_thread_sem_usage   
)

#include <tests/kernel/semaphore/sys_sem/src/main.c>

Test semaphore usage with multiple thread.

Using semaphore with some situations

  • Use a uninitialized semaphore
  • Use semaphore normally
  • Use semaphore with different priority threads