Changeset 97fed44 for tests/concurrent
- Timestamp:
- Jan 25, 2022, 4:54:35 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 6b2d444, a488783, f681823
- Parents:
- f57f6ea0 (diff), 4fcbf26 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- tests/concurrent
- Files:
-
- 4 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrent/.expect/ctor-check.txt
rf57f6ea0 r97fed44 2 2 ?{}: function 3 3 ... with parameters 4 lvalue reference to instance of struct Empty with body4 this: lvalue reference to instance of struct Empty with body 5 5 ... returning nothing 6 6 with body -
tests/concurrent/preempt.cfa
rf57f6ea0 r97fed44 1 #include <fstream.hfa> 1 2 #include <kernel.hfa> 2 3 #include <thread.hfa> … … 25 26 thread worker_t { 26 27 int value; 28 unsigned spin; 27 29 }; 28 30 29 31 void ?{}( worker_t & this, int value ) { 30 32 this.value = value; 33 this.spin = 0; 31 34 } 32 35 33 36 void main(worker_t & this) { 34 37 while(TEST(counter < N)) { 38 if(this.spin > 100_000_000) abort | "Worker" | this.value | "has been spinning too long! (" | this.spin | ")"; 35 39 __cfaabi_check_preemption(); 36 40 if( (counter % 7) == this.value ) { … … 40 44 if( (next % 100) == 0 ) printf("%d\n", (int)next); 41 45 __cfaabi_check_preemption(); 46 this.spin = 0; 42 47 } 43 48 __cfaabi_check_preemption(); 44 49 KICK_WATCHDOG; 50 this.spin++; 45 51 } 46 52 }
Note: See TracChangeset
for help on using the changeset viewer.