1193323Sed//===-- mutex_fuchsia.cpp ---------------------------------------*- C++ -*-===//
2193323Sed//
3193323Sed// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4193323Sed// See https://llvm.org/LICENSE.txt for license information.
5193323Sed// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6193323Sed//
7193323Sed//===----------------------------------------------------------------------===//
8193323Sed
9193323Sed#include "gwp_asan/mutex.h"
10193323Sed
11193323Sed#include <lib/sync/mutex.h>
12193323Sed
13193323Sednamespace gwp_asan {
14193323Sedvoid Mutex::lock() __TA_NO_THREAD_SAFETY_ANALYSIS { sync_mutex_lock(&Mu); }
15193323Sed
16193323Sedbool Mutex::tryLock() __TA_NO_THREAD_SAFETY_ANALYSIS {
17193323Sed  return sync_mutex_trylock(&Mu) == ZX_OK;
18193323Sed}
19193323Sed
20193323Sedvoid Mutex::unlock() __TA_NO_THREAD_SAFETY_ANALYSIS { sync_mutex_unlock(&Mu); }
21193323Sed} // namespace gwp_asan
22193323Sed