chromium/base/synchronization/lock_impl_posix.cc

// Copyright 2011 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/synchronization/lock_impl.h"

#include <ostream>
#include <string>

#include "base/check_op.h"
#include "base/posix/safe_strerror.h"
#include "base/synchronization/lock.h"
#include "base/synchronization/synchronization_buildflags.h"
#include "build/build_config.h"

namespace base {
namespace internal {

namespace {

#if DCHECK_IS_ON()
const char* AdditionalHintForSystemErrorCode(int error_code) {}
#endif  // DCHECK_IS_ON()

std::string SystemErrorCodeToString(int error_code) {}

}  // namespace

#if DCHECK_IS_ON()
// These are out-of-line so that the .h file doesn't have to include ostream.
void dcheck_trylock_result(int rv) {}

void dcheck_unlock_result(int rv) {}
#endif

// Determines which platforms can consider using priority inheritance locks. Use
// this define for platform code that may not compile if priority inheritance
// locks aren't available. For this platform code,
// PRIORITY_INHERITANCE_LOCKS_POSSIBLE() is a necessary but insufficient check.
// Lock::PriorityInheritanceAvailable still must be checked as the code may
// compile but the underlying platform still may not correctly support priority
// inheritance locks.
#if BUILDFLAG(IS_NACL) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA)
#define PRIORITY_INHERITANCE_LOCKS_POSSIBLE
#else
#define PRIORITY_INHERITANCE_LOCKS_POSSIBLE()
#endif

LockImpl::LockImpl() {}

LockImpl::~LockImpl() {}

void LockImpl::LockInternal() {}

// static
bool LockImpl::PriorityInheritanceAvailable() {}

}  // namespace internal
}  // namespace base