Skip to content
Snippets Groups Projects

Avoid busy wait in get_slices thread by using the right check

Merged Roel Aaij requested to merge get_slices_busy_wait into master
All threads resolved!
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
@@ -116,7 +116,7 @@ std::tuple<bool, bool, bool, size_t, size_t, std::any> MEPProvider::get_slice( s
if ( !m_read_error ) {
// If no transposed slices are ready for processing, wait until
// one is; use a timeout if requested
if ( m_transposed.empty() ) {
if ( !has_transposed() ) {
auto wakeup = [this, &has_transposed] { return ( has_transposed() || m_read_error || m_transpose_done ); };
if ( timeout ) {
timed_out = !m_transposed_cond.wait_for( lock, std::chrono::milliseconds{*timeout}, wakeup );
Loading