#include <kernel>
#include <monitor>
#include <thread>

static const unsigned long N  = 500_000ul;

#ifndef PREEMPTION_RATE
#define PREEMPTION_RATE 10`ms
#endif

Duration default_preemption() {
	return PREEMPTION_RATE;
}

monitor mon_t {};

mon_t mon1, mon2, mon3;

void foo( mon_t & mutex a, mon_t & mutex b, mon_t & mutex c ) {}

thread worker_t {};

void main( worker_t & this ) {
	for( unsigned long i = 0; i < N; i++ ) {
		foo( mon1, mon2, mon3 );
	}
}

extern "C" {
static worker_t * workers;
}

int main(int argc, char * argv[] ) {
	processor p;
	{
		worker_t w[7];
		workers = w;
	}
}
