mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-19 03:45:47 +01:00
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
2 changed files with 7 additions and 0 deletions
|
|
@ -213,6 +213,9 @@ Butler::thread_work ()
|
|||
Temporal::TempoMap::fetch ();
|
||||
|
||||
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");
|
||||
disk_work_outstanding = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -737,6 +737,10 @@ DiskWriter::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
|||
_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));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue