1// Copyright 2023 Peter Dimov
2// Distributed under the Boost Software License, Version 1.0.
3// https://www.boost.org/LICENSE_1_0.txt
4
5#include <boost/unordered/detail/foa/rw_spinlock.hpp>
6#include <mutex>
7
8using boost::unordered::detail::foa::rw_spinlock;
9
10// Sanity check only
11
12static rw_spinlock sp;
13static rw_spinlock sp2;
14
15int main()
16{
17 sp.lock();
18 sp2.lock();
19 sp.unlock();
20 sp2.unlock();
21
22 {
23 std::lock_guard<rw_spinlock> lock( sp );
24 std::lock_guard<rw_spinlock> lock2( sp2 );
25 }
26}
27

source code of boost/libs/unordered/test/cfoa/rw_spinlock_test.cpp