source: longrun_tests/enter.cfa @ e8fe5e0

arm-ehcleanup-dtorsjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-expr
Last change on this file since e8fe5e0 was e8fe5e0, checked in by tdelisle <tdelisle@…>, 3 years ago

Fixing longrun_tests to compile

  • Property mode set to 100644
File size: 604 bytes
RevLine 
[73abe95]1#include <kernel.hfa>
2#include <monitor.hfa>
3#include <thread.hfa>
4#include <time.hfa>
[8ee5028]5
[ef952d7]6#define __kick_rate 75000ul
[e8fe5e0]7#include "long_tests.hfa"
[7bdcac1]8
[8ee5028]9#ifndef PREEMPTION_RATE
[b9da9585]10#error PREEMPTION_RATE not defined in makefile
[8ee5028]11#endif
12
[8ad6533]13Duration default_preemption() {
[8ee5028]14        return PREEMPTION_RATE;
15}
16
[b9da9585]17static const unsigned long N  = 2_100_000ul;
18
[8ee5028]19monitor mon_t {};
[7bdcac1]20void foo( mon_t & mutex this ) {
21        KICK_WATCHDOG;
22}
[8ee5028]23
[85b1deb]24mon_t mon;
[8ee5028]25thread worker_t {};
[1449d83]26void main( worker_t & this ) {
[7bdcac1]27        for( unsigned long i = 0; TEST(i < N); i++ ) {
[1449d83]28                foo( mon );
[8ee5028]29        }
30}
31
32int main(int argc, char * argv[] ) {
33        processor p;
34        {
35                worker_t w[7];
36        }
[1449d83]37}
Note: See TracBrowser for help on using the repository browser.