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
        no_list
        persistent-indexer
        pthread-emulation
        qualifiedEnum
      
      
        
          | Last change
 on this file since 982b0a5 was             ef952d7, checked in by Thierry Delisle <tdelisle@…>, 7 years ago | 
        
          | 
Change watchdog tests to output a a frequency smaller than 1Hz
 | 
        
          | 
              
Property                 mode
 set to                 100644 | 
        
          | File size:
            702 bytes | 
      
      
| Line |  | 
|---|
| 1 | #include <kernel> | 
|---|
| 2 | #include <monitor> | 
|---|
| 3 | #include <thread> | 
|---|
| 4 | #include <time> | 
|---|
| 5 |  | 
|---|
| 6 | #define __kick_rate 75000ul | 
|---|
| 7 | #include "long_tests.h" | 
|---|
| 8 |  | 
|---|
| 9 | #ifndef PREEMPTION_RATE | 
|---|
| 10 | #error PREEMPTION_RATE not defined in makefile | 
|---|
| 11 | #endif | 
|---|
| 12 |  | 
|---|
| 13 | Duration default_preemption() { | 
|---|
| 14 | return PREEMPTION_RATE; | 
|---|
| 15 | } | 
|---|
| 16 |  | 
|---|
| 17 | static const unsigned long N  = 500_000ul; | 
|---|
| 18 |  | 
|---|
| 19 | monitor mon_t {}; | 
|---|
| 20 |  | 
|---|
| 21 | mon_t mon1, mon2, mon3; | 
|---|
| 22 |  | 
|---|
| 23 | void foo( mon_t & mutex a, mon_t & mutex b, mon_t & mutex c ) { | 
|---|
| 24 | KICK_WATCHDOG; | 
|---|
| 25 | } | 
|---|
| 26 |  | 
|---|
| 27 | thread worker_t {}; | 
|---|
| 28 |  | 
|---|
| 29 | void main( worker_t & this ) { | 
|---|
| 30 | for( unsigned long i = 0; TEST(i < N); i++ ) { | 
|---|
| 31 | foo( mon1, mon2, mon3 ); | 
|---|
| 32 | } | 
|---|
| 33 | } | 
|---|
| 34 |  | 
|---|
| 35 | extern "C" { | 
|---|
| 36 | static worker_t * workers; | 
|---|
| 37 | } | 
|---|
| 38 |  | 
|---|
| 39 | int main(int argc, char * argv[] ) { | 
|---|
| 40 | processor p; | 
|---|
| 41 | { | 
|---|
| 42 | worker_t w[7]; | 
|---|
| 43 | workers = w; | 
|---|
| 44 | } | 
|---|
| 45 | } | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.