brintos

brintos / llvm-project-archived public Read only

0
0
Text · 691 B · cd2694e Raw
31 lines · cpp
1//===----------------------------------------------------------------------===//2//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-exception6//7//===----------------------------------------------------------------------===//8 9// UNSUPPORTED: no-threads10 11// <mutex>12 13// class recursive_mutex;14 15// recursive_mutex();16 17#include <mutex>18#include <cassert>19#include <type_traits>20 21int main(int, char**) {22  // The mutex is unlocked after default construction23  {24    std::recursive_mutex m;25    assert(m.try_lock());26    m.unlock();27  }28 29  return 0;30}31