Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/schedint/cfa1.cfa

    r2316525 r6e540ea  
    44#include <stdio.h>
    55
    6 #include "../bench.h"
     6#include "bench.h"
    77
    88volatile int go = 0;
     9
    910condition c;
    10 monitor M {} m1;
     11monitor M {};
     12M m1;
    1113
    12 void __attribute__((noinline)) call( M & mutex p1 ) {
    13         signal( c );
     14void __attribute__((noinline)) call( M & mutex a1 ) {
     15        signal(c);
    1416}
    1517
    16 void __attribute__((noinline)) wait( M & mutex p1 ) {
     18int  __attribute__((noinline)) wait( M & mutex a1 ) {
    1719        go = 1;
    18         for ( times ) {
    19                 wait( c );
    20         }
     20        BENCH(
     21                for ( i; times ) {
     22                        wait(c);
     23                },
     24                result
     25        )
     26        printf( "%g\n", result );
    2127        go = 0;
     28        return 0;
    2229}
    2330
    2431thread T {};
     32void ^?{}( T & mutex ) {}
    2533void main( T & ) {
    26         while ( go == 0 ) { yield(); }
    27         BENCH(
    28                 while ( go == 1 ) { call( m1 ); },
    29                 result
    30         )
    31         printf( "%g\n", result );
     34        while(go == 0) { yield(); }
     35        while(go == 1) { call(m1); }
     36
    3237}
    3338
     
    3540        BENCH_START()
    3641        T t;
    37         wait( m1 );
     42        return wait(m1);
    3843}
    3944
Note: See TracChangeset for help on using the changeset viewer.