]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/libcxx/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.class/native_handle.pass.cpp
Vendor import of libc++ trunk r290819:
[FreeBSD/FreeBSD.git] / test / libcxx / thread / thread.mutex / thread.mutex.requirements / thread.mutex.requirements.mutex / thread.mutex.class / native_handle.pass.cpp
1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // UNSUPPORTED: libcpp-has-no-threads, libcpp-has-thread-api-external
11
12 // <mutex>
13
14 // class mutex;
15
16 // typedef pthread_mutex_t* native_handle_type;
17 // native_handle_type native_handle();
18
19 #include <mutex>
20 #include <cassert>
21
22 int main()
23 {
24     std::mutex m;
25     pthread_mutex_t* h = m.native_handle();
26     assert(h);
27 }