1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: no-threads
10 // UNSUPPORTED: c++03, c++11
14 // template <class Mutex> class shared_lock;
16 // shared_lock(mutex_type& m, adopt_lock_t);
18 #include <shared_mutex>
21 #include "nasty_containers.h"
23 #include "test_macros.h"
28 typedef std::shared_timed_mutex M
;
31 std::unique_lock
<M
> lk(m
, std::adopt_lock
);
32 assert(lk
.mutex() == std::addressof(m
));
33 assert(lk
.owns_lock() == true);
36 typedef nasty_mutex M
;
39 std::unique_lock
<M
> lk(m
, std::adopt_lock
);
40 assert(lk
.mutex() == std::addressof(m
));
41 assert(lk
.owns_lock() == true);