source: src/tests/preempt_longrun/enter.c@ 704d11e

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr no_list persistent-indexer pthread-emulation qualifiedEnum
Last change on this file since 704d11e was 7bdcac1, checked in by Thierry Delisle <tdelisle@…>, 7 years ago

Added the option to make longrun tests run until failure

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