Subversion Repositories HelenOS

Rev

Rev 2210 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2210 Rev 2216
Line 43... Line 43...
43
{
43
{
44
    thread_detach(thread_get_id());
44
    thread_detach(thread_get_id());
45
 
45
 
46
    while (atomic_get(&finish)) {
46
    while (atomic_get(&finish)) {
47
        if (!sh_quiet)
47
        if (!sh_quiet)
48
            printf("%d ", thread_get_id());
48
            printf("%llu ", thread_get_id());
49
        usleep(100000);
49
        usleep(100000);
50
    }
50
    }
51
    atomic_inc(&threads_finished);
51
    atomic_inc(&threads_finished);
52
}
52
}
53
 
53
 
Line 58... Line 58...
58
   
58
   
59
    atomic_set(&finish, 1);
59
    atomic_set(&finish, 1);
60
    atomic_set(&threads_finished, 0);
60
    atomic_set(&threads_finished, 0);
61
 
61
 
62
    for (i = 0; i < THREADS; i++) {  
62
    for (i = 0; i < THREADS; i++) {  
63
        int t;
-
 
64
        if ((t = thread_create(threadtest, NULL, "threadtest")) < 0) {
63
        if (thread_create(threadtest, NULL, "threadtest", NULL) < 0) {
65
            if (!quiet)
64
            if (!quiet)
66
                printf("Could not create thread %d\n", i);
65
                printf("Could not create thread %d\n", i);
67
            break;
66
            break;
68
        }
67
        }
69
        total++;
68
        total++;