Changeset 1612315
- Timestamp:
- Jan 24, 2022, 12:41:00 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- b200492
- Parents:
- c0f881b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrent/preempt.cfa
rc0f881b r1612315 26 26 thread worker_t { 27 27 int value; 28 unsigned spin = 0; 28 29 }; 29 30 30 31 void ?{}( worker_t & this, int value ) { 31 32 this.value = value; 33 this.spin = 0; 32 34 } 33 35 34 36 void main(worker_t & this) { 35 unsigned spin = 0;36 37 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 | ")"; 38 39 __cfaabi_check_preemption(); 39 40 if( (counter % 7) == this.value ) { … … 47 48 __cfaabi_check_preemption(); 48 49 KICK_WATCHDOG; 49 spin++;50 this.spin++; 50 51 } 51 52 }
Note: See TracChangeset
for help on using the changeset viewer.