medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 6f4f0b37a0a7196cdaa3b09996876b9fd1b29e48
parent 88a2e469cac10f7cb5e806b5d393d53235d27f4a
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sun Jan 17 23:08:22 +0000

Thread safety changes in benchmarking code

Diffstat:
benchmark.cc | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/benchmark.cc b/benchmark.cc @@ -16,7 +16,7 @@ struct Timer { volatile u64 num_calls; }; -static Timer timers[ 4096 ]; +static volatile Timer timers[ 4096 ]; static volatile u32 num_timers = 0; ScopedTimer::ScopedTimer( u32 idx ) { @@ -41,6 +41,8 @@ u32 benchmark_new_timer( const char * fn, const char * file, int line ) { info.total_clocks = 0; info.num_calls = 0; + write_barrier(); + timers[ idx ] = info; return idx;