source: src/tests/preempt_longrun/enter.c @ 8ee50281

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 8ee50281 was 8ee50281, checked in by Thierry Delisle <tdelisle@…>, 7 years ago

Added longrun test for monitor mutex

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