Ignore:
Timestamp:
Jun 1, 2021, 4:06:30 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
a804f81
Parents:
bc179fd3
Message:

Changed sum type to uint32_t to make sure integer overflow isn't the problem with fast_lock

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/unified_locking/fast.cfa

    rbc179fd3 r62006a3  
    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];
Note: See TracChangeset for help on using the changeset viewer.