Ignore:
Timestamp:
May 2, 2018, 5:38:06 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
Children:
d28a03e, fb16d5c
Parents:
9d32bc8
Message:

Added more checks to preempt test to make sure preemption stays enabled

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/concurrent/preempt.c

    r9d32bc8 rb68fc85  
    1717#endif
    1818
     19extern void __cfaabi_check_preemption();
     20
    1921static volatile int counter = 0;
    2022
     
    2931void main(worker_t & this) {
    3032        while(counter < N) {
     33                __cfaabi_check_preemption();
    3134                if( (counter % 7) == this.value ) {
     35                        __cfaabi_check_preemption();
    3236                        int next = __atomic_add_fetch_4(&counter, 1, __ATOMIC_SEQ_CST);
     37                        __cfaabi_check_preemption();
    3338                        if( (next % 100) == 0 ) printf("%d\n", (int)next);
     39                        __cfaabi_check_preemption();
    3440                }
     41                __cfaabi_check_preemption();
    3542        }
    3643}
Note: See TracChangeset for help on using the changeset viewer.