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/. */
6 
7 #include "mozilla/Assertions.h"
8 
9 #include <errno.h>
10 #include <stdio.h>
11 
12 #include "mozilla/PlatformMutex.h"
13 #include "MutexPlatformData_noop.h"
14 
MutexImpl()15 mozilla::detail::MutexImpl::MutexImpl() {}
16 
~MutexImpl()17 mozilla::detail::MutexImpl::~MutexImpl() {}
18 
mutexLock()19 inline void mozilla::detail::MutexImpl::mutexLock() {}
20 
tryLock()21 bool mozilla::detail::MutexImpl::tryLock() { return mutexTryLock(); }
22 
mutexTryLock()23 bool mozilla::detail::MutexImpl::mutexTryLock() { return true; }
24 
lock()25 void mozilla::detail::MutexImpl::lock() { mutexLock(); }
26 
unlock()27 void mozilla::detail::MutexImpl::unlock() {}
28 
29 mozilla::detail::MutexImpl::PlatformData*
platformData()30 mozilla::detail::MutexImpl::platformData() {
31   static_assert(sizeof(platformData_) >= sizeof(PlatformData),
32                 "platformData_ is too small");
33   return reinterpret_cast<PlatformData*>(platformData_);
34 }
35