add memory fences to try to avoid a conceptual memory ordering issue between capture & the butler
This commit is contained in:
parent
4137271188
commit
5c69aef56e
@ -213,6 +213,9 @@ Butler::thread_work ()
|
|||||||
Temporal::TempoMap::fetch ();
|
Temporal::TempoMap::fetch ();
|
||||||
|
|
||||||
restart:
|
restart:
|
||||||
|
/* Ensure that no reads migrate before this fence */
|
||||||
|
std::atomic_thread_fence (std::memory_order_acquire);
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::Butler, "at restart for disk work\n");
|
DEBUG_TRACE (DEBUG::Butler, "at restart for disk work\n");
|
||||||
disk_work_outstanding = false;
|
disk_work_outstanding = false;
|
||||||
|
|
||||||
|
@ -737,6 +737,10 @@ DiskWriter::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
|||||||
_need_butler = true;
|
_need_butler = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Ensure that anything written during run() is visible in other threads */
|
||||||
|
|
||||||
|
std::atomic_thread_fence (std::memory_order_release);
|
||||||
|
|
||||||
// DEBUG_TRACE (DEBUG::Butler, string_compose ("%1 writer run, needs butler = %2\n", name(), _need_butler));
|
// DEBUG_TRACE (DEBUG::Butler, string_compose ("%1 writer run, needs butler = %2\n", name(), _need_butler));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user