Changes in tests/concurrent/preempt.cfa [b200492:c701332a]
- File:
-
- 1 edited
-
tests/concurrent/preempt.cfa (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrent/preempt.cfa
rb200492 rc701332a 1 #include <fstream.hfa>2 1 #include <kernel.hfa> 3 2 #include <thread.hfa> … … 26 25 thread worker_t { 27 26 int value; 28 unsigned spin;29 27 }; 30 28 31 29 void ?{}( worker_t & this, int value ) { 32 30 this.value = value; 33 this.spin = 0;34 31 } 35 32 36 33 void main(worker_t & this) { 37 34 while(TEST(counter < N)) { 38 if(this.spin > 100_000_000) abort | "Worker" | this.value | "has been spinning too long! (" | this.spin | ")";39 35 __cfaabi_check_preemption(); 40 36 if( (counter % 7) == this.value ) { … … 44 40 if( (next % 100) == 0 ) printf("%d\n", (int)next); 45 41 __cfaabi_check_preemption(); 46 this.spin = 0;47 42 } 48 43 __cfaabi_check_preemption(); 49 44 KICK_WATCHDOG; 50 this.spin++;51 45 } 52 46 }
Note:
See TracChangeset
for help on using the changeset viewer.