This commit is contained in:
2026-06-11 13:18:12 +03:00
parent f29d07dd1a
commit faa2df92cc
7 changed files with 111 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
#include <stdio.h>
#include <stdlib.h>
#include "../libs/threads.h"
void* task() {
while (1) {
printf("Background task running\n");
wait(1);
}
return NULL;
}
int main() {
void* thread_handle;
start_thread(&thread_handle, task);
printf("Main program continues\n");
wait(5);
kill_thread(thread_handle);
printf("Background task killed\n");
return 0;
}