// Copyright 2023 Peter Dimov // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt #include #include #include using boost::unordered::detail::foa::rw_spinlock; static rw_spinlock sp; static rw_spinlock sp2; int main() { sp.lock(); sp2.lock_shared(); sp2.lock_shared(); sp.unlock(); sp2.unlock_shared(); sp2.unlock_shared(); { std::lock_guard lock( sp ); boost::compat::shared_lock lock2( sp2 ); boost::compat::shared_lock lock3( sp2 ); } }