proc_mgmt: implementation spawn_wait() with nohang flag
[barrelfish] / usr / tests / proc_mgmt_test / main.c
index 46ce106..09e1ccc 100644 (file)
@@ -16,7 +16,6 @@
 #include <barrelfish/barrelfish.h>
 #include <barrelfish/deferred.h>
 #include <barrelfish/sys_debug.h>
-#include <barrelfish/proc_mgmt_client.h>
 #include <barrelfish/spawn_client.h>
 #include <bench/bench.h>
 
@@ -136,9 +135,9 @@ int main(int argc, char **argv)
         } else if (strcmp("span", argv[2]) == 0) {
             // Process that spans domains
             if (disp_get_core_id() == 0) {
-                proc_mgmt_span(1);
+                spawn_span(1);
             } else {
-                proc_mgmt_span(0);
+                spawn_span(0);
             }
             while(true) {
                 event_dispatch(get_default_waitset());
@@ -225,12 +224,22 @@ int main(int argc, char **argv)
     barrelfish_usleep(5*1000*1000);
     
     printf("Waiting for process on same core to finish \n");
+       err = spawn_wait(domain_cap, &code, true);
+       if (err_is_fail(err)) {
+        USER_PANIC("Failed waiting for domain \n");
+       }
+    printf("Nowait hang return code %d \n", code);
        err = spawn_wait(domain_cap, &code, false);
        if (err_is_fail(err)) {
         USER_PANIC("Failed waiting for domain \n");
        }
     printf("Unblocked \n");
 
+       err = spawn_wait(domain_cap, &code, true);
+       if (err_is_fail(err)) {
+        USER_PANIC("Failed waiting for domain \n");
+       }
+    printf("Nowait hang return code %d \n", code);
     printf("Running benchmarks core 0 \n");
     run_benchmark_spawn(0);
     printf("Running benchmarks core 3 \n");