Ignore:
Timestamp:
Apr 23, 2018, 12:57:46 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
57acae0
Parents:
ba89e9b7 (diff), c8ad5d9 (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.
Message:

Merge branch 'master' into references

File:
1 edited

Legend:

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

    rba89e9b7 rda7fe39  
    11#include <kernel>
    22#include <thread>
     3#include <time>
    34
    45#ifndef PREEMPTION_RATE
    5 #define PREEMPTION_RATE 10_000ul
     6#define PREEMPTION_RATE 10`ms
    67#endif
    78
    8 unsigned int default_preemption() {
     9Duration default_preemption() {
    910        return PREEMPTION_RATE;
    1011}
     12
     13#ifdef LONG_TEST
     14static const unsigned long N = 30_000ul;
     15#else
     16static const unsigned long N = 500ul;
     17#endif
    1118
    1219static volatile int counter = 0;
     
    2128
    2229void main(worker_t & this) {
    23         while(counter < 1000) {
     30        while(counter < N) {
    2431                if( (counter % 7) == this.value ) {
    2532                        int next = __atomic_add_fetch_4(&counter, 1, __ATOMIC_SEQ_CST);
Note: See TracChangeset for help on using the changeset viewer.