Changeset 97fed44 for tests/concurrent


Ignore:
Timestamp:
Jan 25, 2022, 4:54:35 PM (3 years ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
6b2d444, a488783, f681823
Parents:
f57f6ea0 (diff), 4fcbf26 (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/concurrent
Files:
4 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • tests/concurrent/.expect/ctor-check.txt

    rf57f6ea0 r97fed44  
    22?{}: function
    33... with parameters
    4   lvalue reference to instance of struct Empty with body
     4  this: lvalue reference to instance of struct Empty with body
    55... returning nothing
    66 with body
  • tests/concurrent/preempt.cfa

    rf57f6ea0 r97fed44  
     1#include <fstream.hfa>
    12#include <kernel.hfa>
    23#include <thread.hfa>
     
    2526thread worker_t {
    2627        int value;
     28        unsigned spin;
    2729};
    2830
    2931void ?{}( worker_t & this, int value ) {
    3032        this.value = value;
     33        this.spin = 0;
    3134}
    3235
    3336void main(worker_t & this) {
    3437        while(TEST(counter < N)) {
     38                if(this.spin > 100_000_000) abort | "Worker" | this.value | "has been spinning too long! (" | this.spin | ")";
    3539                __cfaabi_check_preemption();
    3640                if( (counter % 7) == this.value ) {
     
    4044                        if( (next % 100) == 0 ) printf("%d\n", (int)next);
    4145                        __cfaabi_check_preemption();
     46                        this.spin = 0;
    4247                }
    4348                __cfaabi_check_preemption();
    4449                KICK_WATCHDOG;
     50                this.spin++;
    4551        }
    4652}
Note: See TracChangeset for help on using the changeset viewer.