Home | History | Annotate | Download | only in thread.lock
      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
     11 
     12 // <mutex>
     13 
     14 // struct defer_lock_t {};
     15 // struct try_to_lock_t {};
     16 // struct adopt_lock_t {};
     17 //
     18 // constexpr defer_lock_t  defer_lock{};
     19 // constexpr try_to_lock_t try_to_lock{};
     20 // constexpr adopt_lock_t  adopt_lock{};
     21 
     22 #include <mutex>
     23 #include <type_traits>
     24 
     25 int main()
     26 {
     27     typedef std::defer_lock_t T1;
     28     typedef std::try_to_lock_t T2;
     29     typedef std::adopt_lock_t T3;
     30 
     31     T1 t1 = std::defer_lock;
     32     T2 t2 = std::try_to_lock;
     33     T3 t3 = std::adopt_lock;
     34 }
     35