Bug 1860823 [wpt PR 42716] - Update wpt metadata, a=testonly
[gecko.git] / mozglue / misc / Mutex_noop.cpp
blobeaa7959cc0fd84ad3ac7802b05bfa5b769228431
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "mozilla/Assertions.h"
9 #include <errno.h>
10 #include <stdio.h>
12 #include "mozilla/PlatformMutex.h"
13 #include "MutexPlatformData_noop.h"
15 mozilla::detail::MutexImpl::MutexImpl() {}
17 mozilla::detail::MutexImpl::~MutexImpl() {}
19 inline void mozilla::detail::MutexImpl::mutexLock() {}
21 bool mozilla::detail::MutexImpl::tryLock() { return mutexTryLock(); }
23 bool mozilla::detail::MutexImpl::mutexTryLock() { return true; }
25 void mozilla::detail::MutexImpl::lock() { mutexLock(); }
27 void mozilla::detail::MutexImpl::unlock() {}
29 mozilla::detail::MutexImpl::PlatformData*
30 mozilla::detail::MutexImpl::platformData() {
31 static_assert(sizeof(platformData_) >= sizeof(PlatformData),
32 "platformData_ is too small");
33 return reinterpret_cast<PlatformData*>(platformData_);