Changeset 6fafda8


Ignore:
Timestamp:
Jan 6, 2022, 10:53:44 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
04a8a54, 7d0ebd0
Parents:
eaf269d (diff), 7636fcc (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

Files:
2 added
1 deleted
2 edited
1 moved

Legend:

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

    reaf269d r6fafda8  
    177177};
    178178
     179static inline void ?{}(fast_lock & this) __attribute__((deprecated("use linear_backoff_then_block_lock instead")));
    179180static inline void ?{}(fast_lock & this) { this.owner = 0p; }
    180181
     
    184185}
    185186
    186 static inline void lock( fast_lock & this ) __attribute__((artificial));
     187static inline void lock( fast_lock & this ) __attribute__((deprecated("use linear_backoff_then_block_lock instead"), artificial));
    187188static inline void lock( fast_lock & this ) {
    188189        thread$ * thrd = active_thread();
     
    195196}
    196197
    197 static inline bool try_lock( fast_lock & this ) __attribute__((artificial));
     198static inline bool try_lock( fast_lock & this ) __attribute__((deprecated("use linear_backoff_then_block_lock instead"), artificial));
    198199static inline bool try_lock ( fast_lock & this ) {
    199200        thread$ * thrd = active_thread();
     
    202203}
    203204
    204 static inline thread$ * unlock( fast_lock & this ) __attribute__((artificial));
     205static inline thread$ * unlock( fast_lock & this ) __attribute__((deprecated("use linear_backoff_then_block_lock instead"), artificial));
    205206static inline thread$ * unlock( fast_lock & this ) {
    206207        /* paranoid */ verify(active_thread() == this.owner);
  • tests/unified_locking/mutex_test.hfa

    reaf269d r6fafda8  
    1010        thread$ * id;
    1111        uint32_t sum;
     12        uint32_t cnt;
    1213};
    1314
     
    2728        {
    2829                uint32_t tsum = mo.sum;
     30                uint32_t cnt = mo.cnt;
    2931                mo.id = me;
    3032                yield(random(5));
    3133                value = ((uint32_t)random()) ^ ((uint32_t)me);
    3234                if(mo.id != me) sout | "Intruder!";
     35                mo.cnt = cnt + 1;
    3336                mo.sum = tsum + value;
    3437        }
     
    5457        uint32_t sum = -32;
    5558        mo.sum = -32;
     59        mo.cnt = 0;
    5660        processor p[2];
    5761        sout | "Starting";
     
    6367        }
    6468        sout | "Done!";
     69        if(mo.cnt != (13 * num_times)) sout | "Invalid cs count!" | mo.cnt | "vs "| (13 * num_times) | "(13 *" | num_times | ')';
    6570        if(sum == mo.sum) sout | "Match!";
    6671        else sout | "No Match!" | sum | "vs" | mo.sum;
Note: See TracChangeset for help on using the changeset viewer.