Therefore, the mtp module provides a simpler interface.
Example:
static void example_thread_code(void *data) { while(1) { printf("Test\n"); mt_yield(); } } MTP(example_thread, "Example thread", p1, t1, t1_idle); int main(int argc, char *argv[]) { mtp_start(&example_thread, example_thread_code, NULL); }
Data Structures | |
struct | mt_process |
Defines | |
#define | MT_PROCESS(name, strname) |
Declare a multithreaded process. | |
Functions | |
void | mtp_start (struct mt_process *p, void(*function)(void *), void *data) |
Start a thread. | |
void | mtp_exit (void) |
|
Declare a multithreaded process. This macro is used to declare a multithreaded process. |
|
Start a thread. This function starts the process in which the thread is to run, and also sets up the thread to run within the process. The function should be passed variable names declared with the MTP() macro.
Definition at line 170 of file mt.c. References mt_start(), mt_process::p, process_start(), and mt_process::t. |