Skip to content
Snippets Groups Projects
Commit 9b5bd302 authored by Ben Gamari's avatar Ben Gamari
Browse files

rts: Accept benign races in Proftimer

parent 9801d049
No related branches found
No related tags found
No related merge requests found
...@@ -30,7 +30,7 @@ void ...@@ -30,7 +30,7 @@ void
stopProfTimer( void ) stopProfTimer( void )
{ {
#if defined(PROFILING) #if defined(PROFILING)
do_prof_ticks = false; RELAXED_STORE(&do_prof_ticks, false);
#endif #endif
} }
...@@ -38,14 +38,14 @@ void ...@@ -38,14 +38,14 @@ void
startProfTimer( void ) startProfTimer( void )
{ {
#if defined(PROFILING) #if defined(PROFILING)
do_prof_ticks = true; RELAXED_STORE(&do_prof_ticks, true);
#endif #endif
} }
void void
stopHeapProfTimer( void ) stopHeapProfTimer( void )
{ {
do_heap_prof_ticks = false; RELAXED_STORE(&do_heap_prof_ticks, false);
} }
void void
...@@ -74,7 +74,7 @@ handleProfTick(void) ...@@ -74,7 +74,7 @@ handleProfTick(void)
{ {
#if defined(PROFILING) #if defined(PROFILING)
total_ticks++; total_ticks++;
if (do_prof_ticks) { if (RELAXED_LOAD(&do_prof_ticks)) {
uint32_t n; uint32_t n;
for (n=0; n < n_capabilities; n++) { for (n=0; n < n_capabilities; n++) {
capabilities[n]->r.rCCCS->time_ticks++; capabilities[n]->r.rCCCS->time_ticks++;
...@@ -83,7 +83,7 @@ handleProfTick(void) ...@@ -83,7 +83,7 @@ handleProfTick(void)
} }
#endif #endif
if (do_heap_prof_ticks) { if (RELAXED_LOAD(&do_heap_prof_ticks)) {
ticks_to_heap_profile--; ticks_to_heap_profile--;
if (ticks_to_heap_profile <= 0) { if (ticks_to_heap_profile <= 0) {
ticks_to_heap_profile = RtsFlags.ProfFlags.heapProfileIntervalTicks; ticks_to_heap_profile = RtsFlags.ProfFlags.heapProfileIntervalTicks;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment