Changeset c0f881b
- Timestamp:
- Jan 21, 2022, 1:31:08 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 1612315
- Parents:
- 224916b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrent/preempt.cfa
r224916b rc0f881b 1 #include <fstream.hfa> 1 2 #include <kernel.hfa> 2 3 #include <thread.hfa> … … 32 33 33 34 void main(worker_t & this) { 35 unsigned spin = 0; 34 36 while(TEST(counter < N)) { 37 if(spin > 100_000_000) abort | "Worker" | this.value | "has been spinning too long! (" | spin | ")"; 35 38 __cfaabi_check_preemption(); 36 39 if( (counter % 7) == this.value ) { … … 40 43 if( (next % 100) == 0 ) printf("%d\n", (int)next); 41 44 __cfaabi_check_preemption(); 45 spin = 0; 42 46 } 43 47 __cfaabi_check_preemption(); 44 48 KICK_WATCHDOG; 49 spin++; 45 50 } 46 51 }
Note: See TracChangeset
for help on using the changeset viewer.