#include <stdio.h>
#include "tinycthread.h"
int SayHello(char *name){
printf("Run in new thread [%#x]: Hello, %s\n", thrd_current(), name);
return 0;
}
int main(void){
thrd_t new_thread;
int result = thrd_create(&new_thread, SayHello, "C lang");
if(result == thrd_success){
printf("Run in Main thread[%#x], created new_thread [%#x]\n", thrd_current(), new_thread);
}
thrd_sleep(&(struct timespec) {.tv_sec = 0, .tv_nsec = 10000000}, NULL);
return 0;
}