1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests/cond_order
Francisco Molina 416c048737 tests: add test_utils_interactive_sync when possible
- Define test_utils_interactive_sync as DEFAULT_MODULE in Makefile.tests_common
- For tests disabling autoinit, add test_utils_interactive_sync to main
- Add DISABLE_MODULE += test_utils_interactive_sync for tests requiring
  sudo,  `tests/shell`, `tests/minimal` and `tests/stdin`
- Add shell_commands to tests/periph_wdt and tests/struct_tm_utility to
  pull `r` and `s` commands
- Remove includes and usage in `tests/main.c` for tests that where
  already using test_utils_interactive_sync
2019-11-27 15:07:42 +01:00
..
tests tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
main.c tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
Makefile tests: BOARD_INSUFFICIENT_MEMORY -> Makefile.ci 2019-10-17 15:11:59 +02:00
Makefile.ci tests: add stm32f030f4-demo to Makefile.ci 2019-10-21 15:33:11 +02:00
README.md core: condition variable implementation 2018-11-30 11:22:07 -08:00

Expected result

When successful, you should see 5 different threads printing their PID and priority. The thread with the lowest priority should be able to signaled first, followed by the other threads in the order of their priority (highest next). If the main thread holds the lock, however, none of the other threads should be able to make progress. The output should look like the following:

main(): This is RIOT! (Version: 2018.01-devel-1120-g811de-starbeam-feature-condition-variable)
Condition variable order test
Please refer to the README.md for more information

T3 (prio 6): waiting on condition variable now
T4 (prio 4): waiting on condition variable now
T5 (prio 0): waiting on condition variable now
T6 (prio 2): waiting on condition variable now
T7 (prio 1): waiting on condition variable now
First batch was signaled
T5 (prio 0): condition variable was signaled now
T7 (prio 1): condition variable was signaled now
T6 (prio 2): condition variable was signaled now
First batch has woken up
Second batch was signaled
T4 (prio 4): condition variable was signaled now
T3 (prio 6): condition variable was signaled now
Second batch has woken up

Test END, check the order of priorities above.

Background

This test application stresses a condition variable with a number of threads waiting on it. The threads are signaled (awakened) in two batches.