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