Changeset c0f881b


Ignore:
Timestamp:
Jan 21, 2022, 1:31:08 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
1612315
Parents:
224916b
Message:

Added spin count to the debug test to help identify why it's timing out.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/concurrent/preempt.cfa

    r224916b rc0f881b  
     1#include <fstream.hfa>
    12#include <kernel.hfa>
    23#include <thread.hfa>
     
    3233
    3334void main(worker_t & this) {
     35        unsigned spin = 0;
    3436        while(TEST(counter < N)) {
     37                if(spin > 100_000_000) abort | "Worker" | this.value | "has been spinning too long! (" | spin | ")";
    3538                __cfaabi_check_preemption();
    3639                if( (counter % 7) == this.value ) {
     
    4043                        if( (next % 100) == 0 ) printf("%d\n", (int)next);
    4144                        __cfaabi_check_preemption();
     45                        spin = 0;
    4246                }
    4347                __cfaabi_check_preemption();
    4448                KICK_WATCHDOG;
     49                spin++;
    4550        }
    4651}
Note: See TracChangeset for help on using the changeset viewer.