source: src/tests/preempt_longrun/enter.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: 558 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  = 2_100_000ul;
17
18monitor mon_t {};
19void foo( mon_t & mutex this ) {
20        KICK_WATCHDOG;
21}
22
23mon_t mon;
24thread worker_t {};
25void main( worker_t & this ) {
26        for( unsigned long i = 0; TEST(i < N); i++ ) {
27                foo( mon );
28        }
29}
30
31int main(int argc, char * argv[] ) {
32        processor p;
33        {
34                worker_t w[7];
35        }
36}
Note: See TracBrowser for help on using the repository browser.