source: src/tests/preempt_longrun/yield.c @ 7fb69f6

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprno_listpersistent-indexerpthread-emulationqualifiedEnum
Last change on this file since 7fb69f6 was ef952d7, checked in by Thierry Delisle <tdelisle@…>, 6 years ago

Change watchdog tests to output a a frequency smaller than 1Hz

  • Property mode set to 100644
File size: 615 bytes
Line 
1#include <kernel>
2#include <thread>
3#include <time>
4
5#define __kick_rate 550000ul
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
16#ifdef TEST_LONG
17static const unsigned long N = 9_750_000ul;
18#else
19static const unsigned long N = 325_000ul;
20#endif
21
22thread worker_t {};
23
24void main(worker_t & this) {
25        for(int i = 0; TEST(i < N); i++) {
26                yield();
27                KICK_WATCHDOG;
28        }
29}
30
31extern "C" {
32static worker_t * workers;
33}
34
35int main(int argc, char* argv[]) {
36        processor p;
37        {
38                worker_t w[7];
39                workers = w;
40        }
41}
Note: See TracBrowser for help on using the repository browser.