Implementace vyhradniho rezimu
[mirrors/Programs.git] / c / pthread_extra / test_pause.c
index 467328940c87c786f61b024436de2506a4fa8dc6..ed60fcc6d187ae32501f00378033f512921ba8c8 100644 (file)
@@ -20,8 +20,8 @@ int main() {
        pthread_t a, b;
        pthread_pause_enable(); //Will get inherited by all threads from now on
        //That way you can be sure it is pausable immediately
-       pthread_create(&a, NULL, thread_test, " A");
-       pthread_create(&b, NULL, thread_test, " B");
+       pthread_extra_create(&a, NULL, thread_test, " A");
+       pthread_extra_create(&b, NULL, thread_test, " B");
        //sleep(1);
 
        //printf("OK\n");
@@ -54,6 +54,13 @@ int main() {
                pthread_unpause(a);
                pthread_unpause(b);
                sleep(1);
+
+               printf("SWITCH MAIN ONLY:\n");
+               pthread_pause_all();
+               sleep(1);
+               printf("SWITCH MAIN A+B:\n");
+               pthread_unpause_all();
+               sleep(1);
        }
 
        pthread_join(a, NULL);
This page took 0.135838 seconds and 4 git commands to generate.