f17be8a3de72c378780be4903f8e7ea8be9eb2b1
3 #include <pthread_extra.h>
9 void *thread_test(void *arg
) {
10 //Whole process dies if you kill thread immediately before it is pausable
11 //pthread_pause_enable();
14 printf("Running%s!\n", (char *)arg
);
21 pthread_pause_enable(); //Will get inherited by all threads from now on
22 //That way you can be sure it is pausable immediately
23 pthread_extra_create(&a
, NULL
, thread_test
, " A");
24 pthread_extra_create(&b
, NULL
, thread_test
, " B");
29 for(int32_t i = 1;i>0;i++) {
45 printf("SWITCH A:\n");
48 printf("SWITCH B:\n");
53 printf("SWITCH A+B:\n");
59 pthread_join(a
, NULL
);
60 pthread_join(b
, NULL
);
This page took 0.362757 seconds and 3 git commands to generate.