source: tests/preempt_longrun/enter3.c @ dc8511c

aaron-thesisarm-ehcleanup-dtorsdeferred_resnjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprno_listpersistent-indexer
Last change on this file since dc8511c was dc8511c, checked in by Peter A. Buhr <pabuhr@…>, 3 years ago

first attempt at updating suffixes for test programs

  • Property mode set to 100644
File size: 720 bytes
Line 
1#include <kernel.hfa>
2#include <monitor.hfa>
3#include <thread.hfa>
4#include <time.hfa>
5
6#define __kick_rate 75000ul
7#include "long_tests.hfa"
8
9#ifndef PREEMPTION_RATE
10#error PREEMPTION_RATE not defined in makefile
11#endif
12
13Duration default_preemption() {
14        return PREEMPTION_RATE;
15}
16
17static const unsigned long N  = 500_000ul;
18
19monitor mon_t {};
20
21mon_t mon1, mon2, mon3;
22
23void foo( mon_t & mutex a, mon_t & mutex b, mon_t & mutex c ) {
24        KICK_WATCHDOG;
25}
26
27thread worker_t {};
28
29void main( worker_t & this ) {
30        for( unsigned long i = 0; TEST(i < N); i++ ) {
31                foo( mon1, mon2, mon3 );
32        }
33}
34
35extern "C" {
36static worker_t * workers;
37}
38
39int 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.