Changeset deada67 in mainline for kernel/test/thread/thread1.c


Ignore:
Timestamp:
2006-12-19T17:54:50Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
730376d
Parents:
6536a4a9
Message:

quiet variants of tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/test/thread/thread1.c

    r6536a4a9 rdeada67  
    4141static atomic_t finish;
    4242static atomic_t threads_finished;
     43static bool sh_quiet;
    4344
    4445static void threadtest(void *data)
     
    4748
    4849        while (atomic_get(&finish)) {
    49                 printf("%d\n", (int) (THREAD->tid));
     50                if (!sh_quiet)
     51                        printf("%d\n", (int) (THREAD->tid));
    5052                thread_usleep(100);
    5153        }
     
    5658{
    5759        unsigned int i, total = 0;
     60        sh_quiet = quiet;
    5861       
    5962        atomic_set(&finish, 1);
     
    6366                thread_t *t;
    6467                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);
    6670                        break;
    6771                }
     
    7074        }
    7175       
    72         printf("Running threads for 10 seconds...\n");
     76        if (!quiet)
     77                printf("Running threads for 10 seconds...\n");
    7378        thread_sleep(10);
    7479       
    7580        atomic_set(&finish, 0);
    7681        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));
    7884                thread_sleep(1);
    7985        }
Note: See TracChangeset for help on using the changeset viewer.