Ignore:
Timestamp:
Jun 7, 2021, 2:09:12 PM (5 years ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
Children:
5a46e09
Parents:
82f4063 (diff), 53692b3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
tests/unified_locking
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/unified_locking/fast.cfa

    r82f4063 rbae0d35  
    88        fast_lock l;
    99        $thread * id;
    10         size_t sum;
     10        uint32_t sum;
    1111};
    1212
     
    2020}
    2121
    22 unsigned cs() {
     22uint32_t cs() {
    2323        $thread * me = active_thread();
    24         unsigned value = (unsigned)me;
     24        uint32_t value = (uint32_t)me;
    2525        lock(mo.l);
    2626        {
    27                 size_t tsum = mo.sum;
     27                uint32_t tsum = mo.sum;
    2828                mo.id = me;
    2929                yield(random(5));
     
    3636
    3737thread LockCheck {
    38         size_t sum;
     38        uint32_t sum;
    3939};
    4040
     
    5050
    5151int main() {
    52         size_t sum = -32;
     52        uint32_t sum = -32;
    5353        mo.sum = -32;
    5454        processor p[2];
  • tests/unified_locking/timeout_lock.cfa

    r82f4063 rbae0d35  
    11#include <stdio.h>
    2 #include "locks.hfa"
    3 #include "alarm.hfa"
     2#include <locks.hfa>
     3#include <alarm.hfa>
    44#include <stdlib.hfa>
    55#include <thread.hfa>
    6 #include "kernel.cfa"
     6#include <kernel.hfa>
    77
    88multiple_acquisition_lock m, n;
     
    3333
    3434        for ( unsigned int i = 0; i < NoOfTimes + 3; i += 1 ) {
    35             if ( wait( c_m, m, 1000000`ns ) ) { 
     35            if ( wait( c_m, m, 1000000`ns ) ) {
    3636                        // printf("Thread: %p signalled\n", active_thread()); // removed since can't expect non deterministic output
    3737            } else {
     
    7373        processor p[2];
    7474        printf("Start Test 1: surface testing condition variable timeout routines\n");
    75         wait( c_m, 1`ns );                                                                                                              // bool wait( condition_variable(L) & this, Duration duration );       
     75        wait( c_m, 1`ns );                                                                                                              // bool wait( condition_variable(L) & this, Duration duration );
    7676        wait( c_m, 10, 1`ns );                                                                                                  // bool wait( condition_variable(L) & this, uintptr_t info, Duration duration );
    7777        lock(m); wait( c_m, m, 1`ns ); unlock(m);                                                               // bool wait( condition_variable(L) & this, L & l, Duration duration );
Note: See TracChangeset for help on using the changeset viewer.