source: benchmark/benchcltr.hfa@ 29cb302

ADT arm-eh ast-experimental enum forall-pointer-decay jacob/cs343-translation new-ast new-ast-unique-expr pthread-emulation qualifiedEnum stuck-waitfor-destruct
Last change on this file since 29cb302 was 2649ff9, checked in by Thierry Delisle <tdelisle@…>, 6 years ago

Added simple yielding benchmark

  • Property mode set to 100644
File size: 520 bytes
Line 
1#pragma once
2
3#include <assert.h>
4#include <kernel.hfa>
5#include <thread.hfa>
6
7struct cluster * the_benchmark_cluster = 0p;
8struct BenchCluster {
9 cluster self;
10};
11
12void ?{}( BenchCluster & this ) {
13 (this.self){ "Benchmark Cluster" };
14
15 assert( the_benchmark_cluster == 0p );
16 the_benchmark_cluster = &this.self;
17}
18
19struct BenchProc {
20 processor self;
21};
22
23void ?{}( BenchProc & this ) {
24 assert( the_benchmark_cluster != 0p );
25 (this.self){ "Benchmark Processor", *the_benchmark_cluster };
26}
27
28
Note: See TracBrowser for help on using the repository browser.