1 //===-- mutex_posix.cpp -----------------------------------------*- C++ -*-===//
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 #include "gwp_asan/mutex.h"
16 int Status
= pthread_mutex_lock(&Mu
);
18 // Remove warning for non-debug builds.
22 bool Mutex::tryLock() { return pthread_mutex_trylock(&Mu
) == 0; }
24 void Mutex::unlock() {
25 int Status
= pthread_mutex_unlock(&Mu
);
27 // Remove warning for non-debug builds.
30 } // namespace gwp_asan