Simple mount command
[akaros.git] / tests / pthread_test.c
index 999120d..ec17604 100644 (file)
@@ -2,6 +2,7 @@
 #include <pthread.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <sys/time.h>
 
 /* OS dependent #incs */
 #include <parlib.h>
@@ -68,14 +69,20 @@ int main(int argc, char** argv)
        if (nr_vcores) {
                /* Only do the vcore trickery if requested */
                pthread_can_vcore_request(FALSE);       /* 2LS won't manage vcores */
+               pthread_need_tls(FALSE);
                pthread_lib_init();                                     /* gives us one vcore */
                vcore_request(nr_vcores - 1);           /* ghetto incremental interface */
+               for (int i = 0; i < nr_vcores; i++) {
+                       printd("Vcore %d mapped to pcore %d\n", i,
+                              __procinfo.vcoremap[i].pcoreid);
+               }
        }
 
        /* create and join on yield */
        for (int i = 0; i < nr_yield_threads; i++) {
                printf_safe("[A] About to create thread %d\n", i);
-               assert(!pthread_create(&my_threads[i], NULL, &yield_thread, NULL));
+               if (pthread_create(&my_threads[i], NULL, &yield_thread, NULL))
+                       perror("pth_create failed");
        }
        if (gettimeofday(&start_tv, 0))
                perror("Start time error...");