Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <pthread.h>
- static int flag;
- void func1(void)
- {
- flag = 0;
- while(flag)
- {
- printf("YOBA\n");
- }
- }
- void *func2(void *unused)
- {
- printf("THR STARTED\n");
- flag = 1;
- for(;;);
- }
- int main()
- {
- pthread_t thr;
- pthread_create(&thr, NULL, func2, NULL);
- func1();
- for (;;);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement