Changeset deada67 in mainline for kernel/test/thread/thread1.c
- Timestamp:
- 2006-12-19T17:54:50Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 730376d
- Parents:
- 6536a4a9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/test/thread/thread1.c
r6536a4a9 rdeada67 41 41 static atomic_t finish; 42 42 static atomic_t threads_finished; 43 static bool sh_quiet; 43 44 44 45 static void threadtest(void *data) … … 47 48 48 49 while (atomic_get(&finish)) { 49 printf("%d\n", (int) (THREAD->tid)); 50 if (!sh_quiet) 51 printf("%d\n", (int) (THREAD->tid)); 50 52 thread_usleep(100); 51 53 } … … 56 58 { 57 59 unsigned int i, total = 0; 60 sh_quiet = quiet; 58 61 59 62 atomic_set(&finish, 1); … … 63 66 thread_t *t; 64 67 if (!(t = thread_create(threadtest, NULL, TASK, 0, "threadtest", false))) { 65 printf("Could not create thread %d\n", i); 68 if (!quiet) 69 printf("Could not create thread %d\n", i); 66 70 break; 67 71 } … … 70 74 } 71 75 72 printf("Running threads for 10 seconds...\n"); 76 if (!quiet) 77 printf("Running threads for 10 seconds...\n"); 73 78 thread_sleep(10); 74 79 75 80 atomic_set(&finish, 0); 76 81 while (atomic_get(&threads_finished) < total) { 77 printf("Threads left: %d\n", total - atomic_get(&threads_finished)); 82 if (!quiet) 83 printf("Threads left: %d\n", total - atomic_get(&threads_finished)); 78 84 thread_sleep(1); 79 85 }
Note:
See TracChangeset
for help on using the changeset viewer.