Changeset 96348adc in mainline for kernel/test/synch/rwlock3.c


Ignore:
Timestamp:
2006-12-12T17:24:58Z (17 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7e13972
Parents:
34db7fa
Message:

cleanup tests

File:
1 edited

Legend:

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

    r34db7fa r96348adc  
    4040static rwlock_t rwlock;
    4141
    42 static void reader(void *arg);
    43 static void failed(void);
    44 
    4542static void reader(void *arg)
    4643{
     
    5754        rwlock_write_unlock(&rwlock);
    5855        printf("cpu%d, tid %d: success\n", CPU->id, THREAD->tid);                       
    59        
    60         printf("Test passed.\n");       
    61 
    6256}
    6357
    64 static void failed(void)
    65 {
    66         printf("Test failed prematurely.\n");
    67         thread_exit();
    68 }
    69 
    70 void test_rwlock3(void)
     58char * test_rwlock3(void)
    7159{
    7260        int i;
    7361        thread_t *thrd;
    7462       
    75         printf("Read/write locks test #3\n");
    76    
    7763        rwlock_initialize(&rwlock);
    78 
    7964        rwlock_write_lock(&rwlock);
    8065       
    81         for (i=0; i<4; i++) {
     66        for (i = 0; i < 4; i++) {
    8267                thrd = thread_create(reader, NULL, TASK, 0, "reader");
    8368                if (thrd)
    8469                        thread_ready(thrd);
    8570                else
    86                         failed();
     71                        printf("Could not create reader %d\n", i);
    8772        }
    88 
    8973
    9074        thread_sleep(1);
    9175       
    9276        rwlock_write_unlock(&rwlock);
     77       
     78        return NULL;
    9379}
Note: See TracChangeset for help on using the changeset viewer.