Changeset 8f1a99e


Ignore:
Timestamp:
Jul 5, 2021, 4:58:07 PM (5 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
jacob/cs343-translation, master, new-ast-unique-expr
Children:
b7d94ac5
Parents:
7f62b708
Message:

Step 3 Fixed tests

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/future.hfa

    r7f62b708 r8f1a99e  
    3737
    3838                // Fulfil the future, returns whether or not someone was unblocked
    39                 $thread * fulfil( future(T) & this, T result ) {
     39                thread$ * fulfil( future(T) & this, T result ) {
    4040                        this.result = result;
    4141                        return fulfil( (future_t&)this );
  • tests/concurrent/semaphore.cfa

    r7f62b708 r8f1a99e  
    2222
    2323void main(Blocker & this) {
    24         $thread * me = active_thread();
     24        thread$ * me = active_thread();
    2525        this.sum = 0;
    2626        for(num_blocks) {
     
    4545                or else {}
    4646
    47                 $thread * t = V(ben, false);
     47                thread$ * t = V(ben, false);
    4848                if(t) {
    4949                        this.sum += (unsigned)t;
  • tests/concurrent/signal/block.cfa

    r7f62b708 r8f1a99e  
    3333
    3434monitor global_data_t {
    35         $thread * last_thread;
    36         $thread * last_signaller;
     35        thread$ * last_thread;
     36        thread$ * last_signaller;
    3737};
    3838
     
    8282        if( !is_empty( cond ) ) {
    8383
    84                 $thread * next = ( $thread * ) front( cond );
     84                thread$ * next = ( thread$ * ) front( cond );
    8585
    8686                if( ! signal_block( cond ) ) {
  • tests/concurrent/spinaphore.cfa

    r7f62b708 r8f1a99e  
    2121void main(Blocker & this);
    2222
    23 Blocker * from_thread($thread * t) {
     23Blocker * from_thread(thread$ * t) {
    2424        Blocker & nullb = *(Blocker*)0p;
    25         $thread & nullt = (thread&)nullb;
     25        thread$ & nullt = (thread&)nullb;
    2626        uintptr_t offset  = (uintptr_t)&nullt;
    2727        uintptr_t address = ((uintptr_t)t) - offset;
     
    3030
    3131void main(Blocker & this) {
    32         $thread * me = active_thread();
     32        thread$ * me = active_thread();
    3333        Blocker * me1 = &this;
    3434        Blocker * me2 = from_thread(me);
     
    5151        unsigned me = (unsigned)(uintptr_t)&this;
    5252        for(num_unblocks) {
    53                 $thread * t = V(sem, false);
     53                thread$ * t = V(sem, false);
    5454                Blocker * b = from_thread(t);
    5555                b->sum += me;
  • tests/unified_locking/fast.cfa

    r7f62b708 r8f1a99e  
    77struct MutexObj {
    88        fast_lock l;
    9         $thread * id;
     9        thread$ * id;
    1010        uint32_t sum;
    1111};
     
    2121
    2222uint32_t cs() {
    23         $thread * me = active_thread();
     23        thread$ * me = active_thread();
    2424        uint32_t value;
    2525        lock(mo.l);
  • tests/unified_locking/mcs.cfa

    r7f62b708 r8f1a99e  
    77struct MutexObj {
    88        mcs_lock l;
    9         $thread * id;
     9        thread$ * id;
    1010        size_t sum;
    1111};
     
    2121
    2222unsigned cs() {
    23         $thread * me = active_thread();
     23        thread$ * me = active_thread();
    2424        unsigned value = (unsigned)me;
    2525        mcs_node n;
  • tests/unified_locking/thread_test.cfa

    r7f62b708 r8f1a99e  
    4040    for (unsigned int i = 0; i < num_times; i++) {
    4141        dowork(buffer, work_unlocked);
    42         lock(curr_lock);
     42        lock(*curr_lock);
    4343        //printf("lock: %d %p ENTER\n", i, &curr_lock);
    4444        //lock(norm_lock);
    4545        dowork(buffer, work_locked);
    4646        //printf("lock: %d %p LEAVE\n", i, &curr_lock);
    47         unlock(curr_lock);
     47        unlock(*curr_lock);
    4848        //unlock(norm_lock);
    4949        lck = rand() % lockCount;
     
    6565            break;
    6666        default:
    67             break; 
     67            break;
    6868    }
    6969        processor p[threadCount];
Note: See TracChangeset for help on using the changeset viewer.