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
new-env
no_list
persistent-indexer
pthread-emulation
qualifiedEnum
resolv-new
with_gc
Last change
on this file since 3f5a28b was 0322865c, checked in by Thierry Delisle <tdelisle@…>, 8 years ago |
Cleaned long tests to be more consistent and offer more debug information
|
-
Property mode
set to
100644
|
File size:
610 bytes
|
Rev | Line | |
---|
[8ee50281] | 1 | #include <kernel>
|
---|
| 2 | #include <monitor>
|
---|
| 3 | #include <thread>
|
---|
| 4 |
|
---|
| 5 | #undef N
|
---|
| 6 | static const unsigned long N = 50_000ul;
|
---|
| 7 |
|
---|
| 8 | #ifndef PREEMPTION_RATE
|
---|
| 9 | #define PREEMPTION_RATE 10_000ul
|
---|
| 10 | #endif
|
---|
| 11 |
|
---|
| 12 | unsigned int default_preemption() {
|
---|
| 13 | return PREEMPTION_RATE;
|
---|
| 14 | }
|
---|
| 15 |
|
---|
| 16 | monitor mon_t {};
|
---|
| 17 |
|
---|
| 18 | mon_t mon1, mon2, mon3;
|
---|
| 19 |
|
---|
| 20 | void foo( mon_t * mutex a, mon_t * mutex b, mon_t * mutex c ) {}
|
---|
| 21 |
|
---|
| 22 | thread worker_t {};
|
---|
| 23 |
|
---|
| 24 | void main( worker_t * this ) {
|
---|
| 25 | for( unsigned long i = 0; i < N; i++ ) {
|
---|
| 26 | foo( &mon1, &mon2, &mon3 );
|
---|
| 27 | }
|
---|
| 28 | }
|
---|
| 29 |
|
---|
[0322865c] | 30 | extern "C" {
|
---|
| 31 | static worker_t * workers;
|
---|
| 32 | }
|
---|
| 33 |
|
---|
[8ee50281] | 34 | int main(int argc, char * argv[] ) {
|
---|
| 35 | processor p;
|
---|
| 36 | {
|
---|
| 37 | worker_t w[7];
|
---|
[0322865c] | 38 | workers = w;
|
---|
[8ee50281] | 39 | }
|
---|
| 40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.