source:
longrun_tests/enter3.cfa
@
6740533e
Last change on this file since 6740533e was e8fe5e0, checked in by , 6 years ago | |
---|---|
|
|
File size: 720 bytes |
Rev | Line | |
---|---|---|
[73abe95] | 1 | #include <kernel.hfa> |
2 | #include <monitor.hfa> | |
3 | #include <thread.hfa> | |
4 | #include <time.hfa> | |
[8ee50281] | 5 | |
[ef952d7] | 6 | #define __kick_rate 75000ul |
[dc8511c] | 7 | #include "long_tests.hfa" |
[7bdcac1] | 8 | |
[8ee50281] | 9 | #ifndef PREEMPTION_RATE |
[b9da9585] | 10 | #error PREEMPTION_RATE not defined in makefile |
[8ee50281] | 11 | #endif |
12 | ||
[8ad6533] | 13 | Duration default_preemption() { |
[8ee50281] | 14 | return PREEMPTION_RATE; |
15 | } | |
16 | ||
[b9da9585] | 17 | static const unsigned long N = 500_000ul; |
18 | ||
[8ee50281] | 19 | monitor mon_t {}; |
20 | ||
21 | mon_t mon1, mon2, mon3; | |
22 | ||
[7bdcac1] | 23 | void foo( mon_t & mutex a, mon_t & mutex b, mon_t & mutex c ) { |
24 | KICK_WATCHDOG; | |
25 | } | |
[8ee50281] | 26 | |
27 | thread worker_t {}; | |
28 | ||
[1449d83] | 29 | void main( worker_t & this ) { |
[7bdcac1] | 30 | for( unsigned long i = 0; TEST(i < N); i++ ) { |
[1449d83] | 31 | foo( mon1, mon2, mon3 ); |
[8ee50281] | 32 | } |
33 | } | |
34 | ||
[0322865c] | 35 | extern "C" { |
36 | static worker_t * workers; | |
37 | } | |
38 | ||
[8ee50281] | 39 | int main(int argc, char * argv[] ) { |
40 | processor p; | |
41 | { | |
42 | worker_t w[7]; | |
[0322865c] | 43 | workers = w; |
[8ee50281] | 44 | } |
[1449d83] | 45 | } |
Note: See TracBrowser
for help on using the repository browser.