Skip to content

Commit

Permalink
Switch to <boost/core/yield_primitives.hpp>
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Dec 2, 2023
1 parent f3dc810 commit 1fc8e2f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions rw_spinlock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt

#include <boost/smart_ptr/detail/sp_thread_pause.hpp>
#include <boost/smart_ptr/detail/sp_thread_sleep.hpp>
#include <boost/core/yield_primitives.hpp>
#include <atomic>
#include <cstdint>

Expand Down Expand Up @@ -59,10 +58,10 @@ class rw_spinlock
if( state_.compare_exchange_weak( st, newst, std::memory_order_acquire, std::memory_order_relaxed ) ) return;
}

boost::detail::sp_thread_pause();
boost::core::sp_thread_pause();
}

boost::detail::sp_thread_sleep();
boost::core::sp_thread_sleep();
}
}

Expand Down Expand Up @@ -127,7 +126,7 @@ class rw_spinlock
state_.compare_exchange_weak( st, newst, std::memory_order_relaxed, std::memory_order_relaxed );
}

boost::detail::sp_thread_pause();
boost::core::sp_thread_pause();
}

// clear writer pending bit before going to sleep
Expand Down Expand Up @@ -164,7 +163,7 @@ class rw_spinlock
}
}

boost::detail::sp_thread_sleep();
boost::core::sp_thread_sleep();
}
}

Expand Down

0 comments on commit 1fc8e2f

Please sign in to comment.