Ignore:
File:
1 edited

Legend:

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

    ra35b458 r1b20da0  
    5050{
    5151        uint32_t rc;
    52 
     52       
    5353        spinlock_lock(&sem_lock);
    5454        rc = seed % max;
     
    6262        errno_t rc;
    6363        int to;
    64 
     64       
    6565        thread_detach(THREAD);
    66 
     66       
    6767        waitq_sleep(&can_start);
    68 
     68       
    6969        to = random(20000);
    7070        TPRINTF("cpu%u, tid %" PRIu64 " down+ (%d)\n", CPU->id, THREAD->tid, to);
     
    7474                return;
    7575        }
    76 
     76       
    7777        TPRINTF("cpu%u, tid %" PRIu64 " down=\n", CPU->id, THREAD->tid);
    7878        thread_usleep(random(30000));
    79 
     79       
    8080        semaphore_up(&sem);
    8181        TPRINTF("cpu%u, tid %" PRIu64 " up\n", CPU->id, THREAD->tid);
     
    8585{
    8686        uint32_t i, k;
    87 
     87       
    8888        waitq_initialize(&can_start);
    8989        semaphore_initialize(&sem, 5);
    90 
     90       
    9191        thread_t *thrd;
    92 
     92       
    9393        k = random(7) + 1;
    9494        TPRINTF("Creating %" PRIu32 " consumers\n", k);
     
    101101                        TPRINTF("Error creating thread\n");
    102102        }
    103 
     103       
    104104        thread_usleep(20000);
    105105        waitq_wakeup(&can_start, WAKEUP_ALL);
    106 
     106       
    107107        return NULL;
    108108}
Note: See TracChangeset for help on using the changeset viewer.