Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
Semaphore

Functions

void test_multiple_thread_sem_usage (void)
 Test semaphore usage with multiple thread. More...
 
void test_multi_thread_sem_limit (void)
 Test max semaphore can be give and take with multiple thread. More...
 

Detailed Description

Function Documentation

◆ test_multi_thread_sem_limit()

void test_multi_thread_sem_limit ( void  )

#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.

◆ test_multiple_thread_sem_usage()

void test_multiple_thread_sem_usage ( void  )

#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 semphore normally
  • Use semaphore with different priority threads