Changeset 86601a5


Ignore:
Timestamp:
Jun 21, 2022, 11:56:57 AM (3 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
master, pthread-emulation, qualifiedEnum
Children:
b0be3713
Parents:
5a96b36 (diff), 1dbbef6 (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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/unified_locking/mutex_test.hfa

    r5a96b36 r86601a5  
    2222}
    2323
    24 uint32_t cs() {
     24uint32_t cs(uint32_t & entries) {
    2525        thread$ * me = active_thread();
    2626        uint32_t value;
    2727        lock(mo.l);
    2828        {
     29                entries++;
    2930                uint32_t tsum = mo.sum;
    3031                uint32_t cnt = mo.cnt;
     
    4243thread LockCheck {
    4344        uint32_t sum;
     45        uint32_t entries;
    4446};
    4547
    4648void main(LockCheck & this) {
    4749        this.sum = 0;
     50        this.entries = 0;
    4851        for(num_times) {
    4952                trash();
    50                 this.sum += cs();
     53                this.sum += cs( this.entries );
    5154                trash();
    5255                yield(random(10));
     
    5861        mo.sum = -32;
    5962        mo.cnt = 0;
     63        uint32_t real_entries = 0;
    6064        processor p[2];
    6165        sout | "Starting";
     
    6367                LockCheck checkers[13];
    6468                for(i;13) {
    65                         sum += join(checkers[i]).sum;
     69                        LockCheck & curr = join(checkers[i]);
     70                        sum += curr.sum;
     71                        real_entries += curr.entries;
    6672                }
    6773        }
    6874        sout | "Done!";
    69         if(mo.cnt != (13 * num_times)) sout | "Invalid cs count!" | mo.cnt | "vs "| (13 * num_times) | "(13 *" | num_times | ')';
     75        if(real_entries != (13 * num_times)) sout | "Invalid real cs count!" | mo.cnt | "vs "| (13 * num_times) | "(13 *" | num_times | ')';
     76        if(mo.cnt != (13 * num_times)) sout | "Invalid concurrent cs count!" | mo.cnt | "vs "| (13 * num_times) | "(13 *" | num_times | ')';
    7077        if(sum == mo.sum) sout | "Match!";
    7178        else sout | "No Match!" | sum | "vs" | mo.sum;
Note: See TracChangeset for help on using the changeset viewer.