Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/concurrent/preempt.cfa

    rb200492 rc701332a  
    1 #include <fstream.hfa>
    21#include <kernel.hfa>
    32#include <thread.hfa>
     
    2625thread worker_t {
    2726        int value;
    28         unsigned spin;
    2927};
    3028
    3129void ?{}( worker_t & this, int value ) {
    3230        this.value = value;
    33         this.spin = 0;
    3431}
    3532
    3633void main(worker_t & this) {
    3734        while(TEST(counter < N)) {
    38                 if(this.spin > 100_000_000) abort | "Worker" | this.value | "has been spinning too long! (" | this.spin | ")";
    3935                __cfaabi_check_preemption();
    4036                if( (counter % 7) == this.value ) {
     
    4440                        if( (next % 100) == 0 ) printf("%d\n", (int)next);
    4541                        __cfaabi_check_preemption();
    46                         this.spin = 0;
    4742                }
    4843                __cfaabi_check_preemption();
    4944                KICK_WATCHDOG;
    50                 this.spin++;
    5145        }
    5246}
Note: See TracChangeset for help on using the changeset viewer.