Changeset 1612315


Ignore:
Timestamp:
Jan 24, 2022, 12:41:00 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
b200492
Parents:
c0f881b
Message:

Change spin count to be a member so it can be viewed in core-dumps.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/concurrent/preempt.cfa

    rc0f881b r1612315  
    2626thread worker_t {
    2727        int value;
     28        unsigned spin = 0;
    2829};
    2930
    3031void ?{}( worker_t & this, int value ) {
    3132        this.value = value;
     33        this.spin = 0;
    3234}
    3335
    3436void main(worker_t & this) {
    35         unsigned spin = 0;
    3637        while(TEST(counter < N)) {
    37                 if(spin > 100_000_000) abort | "Worker" | this.value | "has been spinning too long! (" | spin | ")";
     38                if(this.spin > 100_000_000) abort | "Worker" | this.value | "has been spinning too long! (" | this.spin | ")";
    3839                __cfaabi_check_preemption();
    3940                if( (counter % 7) == this.value ) {
     
    4748                __cfaabi_check_preemption();
    4849                KICK_WATCHDOG;
    49                 spin++;
     50                this.spin++;
    5051        }
    5152}
Note: See TracChangeset for help on using the changeset viewer.