CringeDB/tests/System Abstraction/5/threadsTest.c

16 lines
518 B
C
Raw Permalink Normal View History

2024-02-18 17:49:32 +01:00
#include "../../../System Abstraction/cdb_system.h"
2022-08-30 13:28:21 +02:00
#include <stdio.h>
2022-08-30 13:42:25 +02:00
__attribute__ ((sysv_abi)) void testProc(void * arg){
2022-08-30 13:28:21 +02:00
printf("in testProc ... Going to sleep, %i\n", *(int *)arg);
2024-02-18 17:42:05 +01:00
sys_threadSleep(5);
2022-08-30 13:28:21 +02:00
printf("after sleeping in testProc\n");
}
int main(){
int amogus = 1234567;
2024-02-18 17:42:05 +01:00
printf("Thread creation succesfull? %i\n", sys_threadNew(&testProc, &amogus));
2022-08-30 13:28:21 +02:00
printf("Going to sleep in main Thread\n");
2024-02-18 17:42:05 +01:00
sys_threadSleep(10);
2022-08-30 13:28:21 +02:00
printf("After sleeping in main Thread\n");
}