thread
This commit is contained in:
parent
53e51ca468
commit
88e523ca73
1 changed files with 14 additions and 0 deletions
14
thread.c
Normal file
14
thread.c
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void *worker(void *arg) {
|
||||
printf("Hello from thread\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int main() {
|
||||
pthread_t thread;
|
||||
pthread_create(&thread, NULL, worker, NULL);
|
||||
pthread_join(thread, NULL);
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue