Changeset 43114c5 in mainline for test/synch/semaphore2/test.c


Ignore:
Timestamp:
2005-04-09T18:22:53Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8262010
Parents:
e6ba9a3f
Message:

Introduce macros CPU, THREAD, TASK and use them to replace the→cpu, the→thread, the→task.
Later on, this will make it possible to reference *current* cpu, thread and/or task without the aid from virtual memory.

File:
1 edited

Legend:

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

    re6ba9a3f r43114c5  
    7070       
    7171        to = random(20000);
    72         printf("cpu%d, tid %d down+ (%d)\n", the->cpu->id, the->thread->tid, to);
     72        printf("cpu%d, tid %d down+ (%d)\n", CPU->id, THREAD->tid, to);
    7373        rc = semaphore_down_timeout(&sem, to);
    7474        if (SYNCH_FAILED(rc)) {
    75                 printf("cpu%d, tid %d down!\n", the->cpu->id, the->thread->tid);
     75                printf("cpu%d, tid %d down!\n", CPU->id, THREAD->tid);
    7676                return;
    7777        }
    7878       
    79         printf("cpu%d, tid %d down=\n", the->cpu->id, the->thread->tid);       
     79        printf("cpu%d, tid %d down=\n", CPU->id, THREAD->tid); 
    8080        thread_usleep(random(30000));
    8181       
    8282        semaphore_up(&sem);
    83         printf("cpu%d, tid %d up\n", the->cpu->id, the->thread->tid);
     83        printf("cpu%d, tid %d up\n", CPU->id, THREAD->tid);
    8484}
    8585
     
    108108                printf("Creating %d consumers\n", k);
    109109                for (i=0; i<k; i++) {
    110                         thrd = thread_create(consumer, NULL, the->task, 0);
     110                        thrd = thread_create(consumer, NULL, TASK, 0);
    111111                        if (thrd)
    112112                                thread_ready(thrd);
Note: See TracChangeset for help on using the changeset viewer.