Changeset 183788f1 in mainline for uspace/tester/thread/thread1.c
- Timestamp:
- 2007-04-09T16:17:25Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 36f19c0
- Parents:
- de33dab
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/tester/thread/thread1.c
rde33dab r183788f1 34 34 #include <stdio.h> 35 35 #include <unistd.h> 36 #include <futex.h>37 36 #include "../tester.h" 38 37 … … 41 40 static bool sh_quiet; 42 41 43 static atomic_t srlz = FUTEX_INITIALIZER;44 45 42 static void threadtest(void *data) 46 43 { … … 48 45 49 46 while (atomic_get(&finish)) { 50 if (!sh_quiet) { 51 futex_down(&srlz); 47 if (!sh_quiet) 52 48 printf("%llu ", thread_get_id()); 53 futex_up(&srlz);54 }55 49 usleep(100000); 56 50 } … … 75 69 } 76 70 77 if (!quiet) { 78 futex_down(&srlz); 71 if (!quiet) 79 72 printf("Running threads for 10 seconds...\n"); 80 futex_up(&srlz);81 }82 73 sleep(10); 83 74
Note:
See TracChangeset
for help on using the changeset viewer.