Threads in RIOT are functions with signature
void *thread_handler(void *arg);
Use thread_create()
from
thread.h
to start it
thread_create(stack, sizeof(stack),
THREAD_PRIORITY_MAIN - 1,
THREAD_CREATE_STACKTEST,
thread_handler,
NULL, "thread");
thread_create returns a kernel_pid_t type, which can be helpful to assign to a variable (but not necessary for this lesson).
- Start the thread
"thread"
from withinmain()
- Run the application on
native
:make all term
- Check your output, it should read:
I'm in "thread" now