Changeset cb01e1e in mainline for kernel/test/synch/semaphore2.c


Ignore:
Timestamp:
2009-04-04T00:26:27Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a85aebd
Parents:
171f9a1
Message:

use global variable and a macro for silencing tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/test/synch/semaphore2.c

    r171f9a1 rcb01e1e  
    5151{
    5252        uint32_t rc;
    53 
    54         spinlock_lock(&sem_lock);       
     53       
     54        spinlock_lock(&sem_lock);
    5555        rc = seed % max;
    5656        seed = (((seed << 2) ^ (seed >> 2)) * 487) + rc;
     
    6868       
    6969        to = random(20000);
    70         printf("cpu%u, tid %" PRIu64 " down+ (%d)\n", CPU->id, THREAD->tid, to);
     70        TPRINTF("cpu%u, tid %" PRIu64 " down+ (%d)\n", CPU->id, THREAD->tid, to);
    7171        rc = semaphore_down_timeout(&sem, to);
    7272        if (SYNCH_FAILED(rc)) {
    73                 printf("cpu%u, tid %" PRIu64 " down!\n", CPU->id, THREAD->tid);
     73                TPRINTF("cpu%u, tid %" PRIu64 " down!\n", CPU->id, THREAD->tid);
    7474                return;
    7575        }
    7676       
    77         printf("cpu%u, tid %" PRIu64 " down=\n", CPU->id, THREAD->tid);
     77        TPRINTF("cpu%u, tid %" PRIu64 " down=\n", CPU->id, THREAD->tid);       
    7878        thread_usleep(random(30000));
    7979       
    8080        semaphore_up(&sem);
    81         printf("cpu%u, tid %" PRIu64 " up\n", CPU->id, THREAD->tid);
     81        TPRINTF("cpu%u, tid %" PRIu64 " up\n", CPU->id, THREAD->tid);
    8282}
    8383
    84 char * test_semaphore2(bool quiet)
     84char *test_semaphore2(void)
    8585{
    8686        uint32_t i, k;
     
    9292       
    9393        k = random(7) + 1;
    94         printf("Creating %" PRIu32 " consumers\n", k);
     94        TPRINTF("Creating %" PRIu32 " consumers\n", k);
    9595        for (i = 0; i < k; i++) {
    9696                thrd = thread_create(consumer, NULL, TASK, 0, "consumer", false);
     
    9898                        thread_ready(thrd);
    9999                else
    100                         printf("Error creating thread\n");
     100                        TPRINTF("Error creating thread\n");
    101101        }
    102102       
Note: See TracChangeset for help on using the changeset viewer.