1 //===-- mutex_fuchsia.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"
11 #include <lib/sync/mutex.h>
14 void Mutex::lock() __TA_NO_THREAD_SAFETY_ANALYSIS
{ sync_mutex_lock(&Mu
); }
16 bool Mutex::tryLock() __TA_NO_THREAD_SAFETY_ANALYSIS
{
17 return sync_mutex_trylock(&Mu
) == ZX_OK
;
20 void Mutex::unlock() __TA_NO_THREAD_SAFETY_ANALYSIS
{ sync_mutex_unlock(&Mu
); }
21 } // namespace gwp_asan