#include <zephyr/kernel.h>
#include <zephyr/arch/cpu.h>
#include <zephyr/sys/arch_interface.h>
#include <zpp.hpp>
#include <chrono>
Go to the source code of this file.
◆ NUM_THREADS
◆ STACK_SIZE
#define STACK_SIZE (1024 + CONFIG_TEST_EXTRA_STACK_SIZE) |
◆ main()
Definition at line 56 of file main.cpp.
65 t[i] =
zpp::thread(tcb[i], tstack(i), attrs, &worker_thread, i);
70 printk(
"[thread %s] all threads started\n", __func__);
79 printk(
"[thread %s] done is %d which is < %d so waiting on cond\n",
85 auto res = cv.wait(m);
86 __ASSERT_NO_MSG(res ==
true);
88 printk(
"[thread %s] wake - cond was signalled.\n", __func__);
96 auto res = t[i].join();
97 __ASSERT_NO_MSG(res ==
true);
100 printk(
"[thread %s] done == %d so everyone is done\n",
lock_guard using zpp::mutex as a lock.
Thread creation attributes.
static constexpr thread_prio preempt(int prio) noexcept
Create a preemptive priority value.
The class thread repecents a single Zephyr thread.
References zpp::no, NUM_THREADS, and zpp::thread_prio::preempt().