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()15mozilla::detail::MutexImpl::MutexImpl() {} 16 ~MutexImpl()17mozilla::detail::MutexImpl::~MutexImpl() {} 18 mutexLock()19inline void mozilla::detail::MutexImpl::mutexLock() {} 20 tryLock()21bool mozilla::detail::MutexImpl::tryLock() { return mutexTryLock(); } 22 mutexTryLock()23bool mozilla::detail::MutexImpl::mutexTryLock() { return true; } 24 lock()25void mozilla::detail::MutexImpl::lock() { mutexLock(); } 26 unlock()27void mozilla::detail::MutexImpl::unlock() {} 28 29 mozilla::detail::MutexImpl::PlatformData* platformData()30mozilla::detail::MutexImpl::platformData() { 31 static_assert(sizeof(platformData_) >= sizeof(PlatformData), 32 "platformData_ is too small"); 33 return reinterpret_cast<PlatformData*>(platformData_); 34 } 35