ADT
        aaron-thesis
        arm-eh
        ast-experimental
        cleanup-dtors
        deferred_resn
        demangler
        enum
        forall-pointer-decay
        jacob/cs343-translation
        jenkins-sandbox
        new-ast
        new-ast-unique-expr
        new-env
        no_list
        persistent-indexer
        pthread-emulation
        qualifiedEnum
        with_gc
      
      
        
          | 
            Last change
 on this file since d56cc219 was             b9da9585, checked in by Thierry Delisle <tdelisle@…>, 7 years ago           | 
        
        
          | 
             
Fixed long run tests 
 
           | 
        
        
          
            
              - 
Property                 mode
 set to                 
100644
               
             
           | 
        
        
          | 
            File size:
            538 bytes
           | 
        
      
      
| Line |   | 
|---|
| 1 | #include <kernel>
 | 
|---|
| 2 | #include <thread>
 | 
|---|
| 3 | #include <time>
 | 
|---|
| 4 | 
 | 
|---|
| 5 | #ifndef PREEMPTION_RATE
 | 
|---|
| 6 | #error PREEMPTION_RATE not defined in makefile
 | 
|---|
| 7 | #endif
 | 
|---|
| 8 | 
 | 
|---|
| 9 | Duration default_preemption() {
 | 
|---|
| 10 |         return PREEMPTION_RATE;
 | 
|---|
| 11 | }
 | 
|---|
| 12 | 
 | 
|---|
| 13 | #ifdef LONG_TEST
 | 
|---|
| 14 | static const unsigned long N = 9_750_000ul;
 | 
|---|
| 15 | #else
 | 
|---|
| 16 | static const unsigned long N = 325_000ul;
 | 
|---|
| 17 | #endif
 | 
|---|
| 18 | 
 | 
|---|
| 19 | thread worker_t {};
 | 
|---|
| 20 | 
 | 
|---|
| 21 | void main(worker_t & this) {
 | 
|---|
| 22 |         for(int i = 0; i < N; i++) {
 | 
|---|
| 23 |                 yield();
 | 
|---|
| 24 |         }
 | 
|---|
| 25 | }
 | 
|---|
| 26 | 
 | 
|---|
| 27 | extern "C" {
 | 
|---|
| 28 | static worker_t * workers;
 | 
|---|
| 29 | }
 | 
|---|
| 30 | 
 | 
|---|
| 31 | int main(int argc, char* argv[]) {
 | 
|---|
| 32 |         processor p;
 | 
|---|
| 33 |         {
 | 
|---|
| 34 |                 worker_t w[7];
 | 
|---|
| 35 |                 workers = w;
 | 
|---|
| 36 |         }
 | 
|---|
| 37 | }
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.