source: src/tests/preempt_longrun/enter.c @ 0394c31

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since 0394c31 was 1449d83, checked in by Thierry Delisle <tdelisle@…>, 7 years ago

Updated longrun tests which where out of date

  • Property mode set to 100644
File size: 542 bytes
RevLine 
[8ee50281]1#include <kernel>
2#include <monitor>
3#include <thread>
4
[f3c1737]5static const unsigned long N  = 70_000ul;
[8ee50281]6
7#ifndef PREEMPTION_RATE
8#define PREEMPTION_RATE 10_000ul
9#endif
10
11unsigned int default_preemption() {
12        return PREEMPTION_RATE;
13}
14
15monitor mon_t {};
16
17mon_t mon;
18
[1449d83]19void foo( mon_t & mutex this ) {}
[8ee50281]20
21thread worker_t {};
22
[1449d83]23void main( worker_t & this ) {
[8ee50281]24        for( unsigned long i = 0; i < N; i++ ) {
[1449d83]25                foo( mon );
[8ee50281]26        }
27}
28
[0322865c]29extern "C" {
30static worker_t * workers;
31}
32
[8ee50281]33int main(int argc, char * argv[] ) {
34        processor p;
35        {
36                worker_t w[7];
[0322865c]37                workers = w;
[8ee50281]38        }
[1449d83]39}
Note: See TracBrowser for help on using the repository browser.