source: src/tests/preempt_longrun/enter3.c @ 7bdcac1

aaron-thesisarm-ehcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumwith_gc
Last change on this file since 7bdcac1 was 7bdcac1, checked in by Thierry Delisle <tdelisle@…>, 5 years ago

Added the option to make longrun tests run until failure

  • Property mode set to 100644
File size: 674 bytes
Line 
1#include <kernel>
2#include <monitor>
3#include <thread>
4#include <time>
5
6#include "long_tests.h"
7
8#ifndef PREEMPTION_RATE
9#error PREEMPTION_RATE not defined in makefile
10#endif
11
12Duration default_preemption() {
13        return PREEMPTION_RATE;
14}
15
16static const unsigned long N  = 500_000ul;
17
18monitor mon_t {};
19
20mon_t mon1, mon2, mon3;
21
22void foo( mon_t & mutex a, mon_t & mutex b, mon_t & mutex c ) {
23        KICK_WATCHDOG;
24}
25
26thread worker_t {};
27
28void main( worker_t & this ) {
29        for( unsigned long i = 0; TEST(i < N); i++ ) {
30                foo( mon1, mon2, mon3 );
31        }
32}
33
34extern "C" {
35static worker_t * workers;
36}
37
38int main(int argc, char * argv[] ) {
39        processor p;
40        {
41                worker_t w[7];
42                workers = w;
43        }
44}
Note: See TracBrowser for help on using the repository browser.