Skip to content

Commit

Permalink
Workaround GCC 11.3 compiler bug (#339)
Browse files Browse the repository at this point in the history
Compiling on GCC 11.3 breaks due to this compiler bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103871. Using the workaround in [this](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103871#c10) comment seems to fix the issue.

Tested on 11.3 locally. Changes should be benign. No way to test this in CI without adding GCC 11.3 to the build matrix.

Authors:
  - Michael Demoret (https://github.com/mdemoret-nv)

Approvers:
  - David Gardner (https://github.com/dagardner-nv)

URL: #339
  • Loading branch information
mdemoret-nv authored Jun 30, 2023
1 parent 37a3c36 commit d96910b
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions cpp/mrc/include/mrc/coroutines/ring_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,25 +158,44 @@ class RingBuffer
return (!m_stopped ? RingBufferOpStatus::Success : RingBufferOpStatus::Stopped);
}

WriteOperation& use_scheduling_policy(SchedulePolicy policy)
WriteOperation& use_scheduling_policy(SchedulePolicy policy) &
{
m_policy = policy;
return *this;
}

WriteOperation& resume_immediately()
WriteOperation use_scheduling_policy(SchedulePolicy policy) &&
{
m_policy = policy;
return std::move(*this);
}

WriteOperation& resume_immediately() &
{
m_policy = SchedulePolicy::Immediate;
return *this;
}

WriteOperation& resume_on(ThreadPool* thread_pool)
WriteOperation resume_immediately() &&
{
m_policy = SchedulePolicy::Immediate;
return std::move(*this);
}

WriteOperation& resume_on(ThreadPool* thread_pool) &
{
m_policy = SchedulePolicy::Reschedule;
set_resume_on_thread_pool(thread_pool);
return *this;
}

WriteOperation resume_on(ThreadPool* thread_pool) &&
{
m_policy = SchedulePolicy::Reschedule;
set_resume_on_thread_pool(thread_pool);
return std::move(*this);
}

private:
friend RingBuffer;

Expand Down

0 comments on commit d96910b

Please sign in to comment.