| Index: third_party/WebKit/Source/wtf/ThreadingPthreads.cpp
|
| diff --git a/third_party/WebKit/Source/wtf/ThreadingPthreads.cpp b/third_party/WebKit/Source/wtf/ThreadingPthreads.cpp
|
| index 89968862a34bec6ae148e64018b24f4eb18496de..49a35eb33906c2ab6863979184258aeec1721f92 100644
|
| --- a/third_party/WebKit/Source/wtf/ThreadingPthreads.cpp
|
| +++ b/third_party/WebKit/Source/wtf/ThreadingPthreads.cpp
|
| @@ -63,7 +63,7 @@ static Mutex* atomicallyInitializedStaticMutex;
|
|
|
| void initializeThreading() {
|
| // This should only be called once.
|
| - ASSERT(!atomicallyInitializedStaticMutex);
|
| + DCHECK(!atomicallyInitializedStaticMutex);
|
|
|
| // StringImpl::empty() does not construct its static string in a threadsafe
|
| // fashion, so ensure it has been initialized from here.
|
| @@ -78,7 +78,7 @@ void initializeThreading() {
|
| }
|
|
|
| void lockAtomicallyInitializedStaticMutex() {
|
| - ASSERT(atomicallyInitializedStaticMutex);
|
| + DCHECK(atomicallyInitializedStaticMutex);
|
| atomicallyInitializedStaticMutex->lock();
|
| }
|
|
|
| @@ -106,7 +106,7 @@ MutexBase::MutexBase(bool recursive) {
|
|
|
| int result = pthread_mutex_init(&m_mutex.m_internalMutex, &attr);
|
| DCHECK_EQ(result, 0);
|
| -#if ENABLE(ASSERT)
|
| +#if DCHECK_IS_ON()
|
| m_mutex.m_recursionCount = 0;
|
| #endif
|
|
|
| @@ -121,14 +121,14 @@ MutexBase::~MutexBase() {
|
| void MutexBase::lock() {
|
| int result = pthread_mutex_lock(&m_mutex.m_internalMutex);
|
| DCHECK_EQ(result, 0);
|
| -#if ENABLE(ASSERT)
|
| +#if DCHECK_IS_ON()
|
| ++m_mutex.m_recursionCount;
|
| #endif
|
| }
|
|
|
| void MutexBase::unlock() {
|
| -#if ENABLE(ASSERT)
|
| - ASSERT(m_mutex.m_recursionCount);
|
| +#if DCHECK_IS_ON()
|
| + DCHECK(m_mutex.m_recursionCount);
|
| --m_mutex.m_recursionCount;
|
| #endif
|
| int result = pthread_mutex_unlock(&m_mutex.m_internalMutex);
|
| @@ -143,10 +143,10 @@ void MutexBase::unlock() {
|
| bool Mutex::tryLock() {
|
| int result = pthread_mutex_trylock(&m_mutex.m_internalMutex);
|
| if (result == 0) {
|
| -#if ENABLE(ASSERT)
|
| +#if DCHECK_IS_ON()
|
| // The Mutex class is not recursive, so the recursionCount should be
|
| // zero after getting the lock.
|
| - ASSERT(!m_mutex.m_recursionCount);
|
| + DCHECK(!m_mutex.m_recursionCount);
|
| ++m_mutex.m_recursionCount;
|
| #endif
|
| return true;
|
| @@ -154,14 +154,14 @@ bool Mutex::tryLock() {
|
| if (result == EBUSY)
|
| return false;
|
|
|
| - ASSERT_NOT_REACHED();
|
| + NOTREACHED();
|
| return false;
|
| }
|
|
|
| bool RecursiveMutex::tryLock() {
|
| int result = pthread_mutex_trylock(&m_mutex.m_internalMutex);
|
| if (result == 0) {
|
| -#if ENABLE(ASSERT)
|
| +#if DCHECK_IS_ON()
|
| ++m_mutex.m_recursionCount;
|
| #endif
|
| return true;
|
| @@ -169,7 +169,7 @@ bool RecursiveMutex::tryLock() {
|
| if (result == EBUSY)
|
| return false;
|
|
|
| - ASSERT_NOT_REACHED();
|
| + NOTREACHED();
|
| return false;
|
| }
|
|
|
| @@ -185,7 +185,7 @@ void ThreadCondition::wait(MutexBase& mutex) {
|
| PlatformMutex& platformMutex = mutex.impl();
|
| int result = pthread_cond_wait(&m_condition, &platformMutex.m_internalMutex);
|
| DCHECK_EQ(result, 0);
|
| -#if ENABLE(ASSERT)
|
| +#if DCHECK_IS_ON()
|
| ++platformMutex.m_recursionCount;
|
| #endif
|
| }
|
| @@ -209,7 +209,7 @@ bool ThreadCondition::timedWait(MutexBase& mutex, double absoluteTime) {
|
| PlatformMutex& platformMutex = mutex.impl();
|
| int result = pthread_cond_timedwait(
|
| &m_condition, &platformMutex.m_internalMutex, &targetTime);
|
| -#if ENABLE(ASSERT)
|
| +#if DCHECK_IS_ON()
|
| ++platformMutex.m_recursionCount;
|
| #endif
|
| return result == 0;
|
| @@ -225,7 +225,7 @@ void ThreadCondition::broadcast() {
|
| DCHECK_EQ(result, 0);
|
| }
|
|
|
| -#if ENABLE(ASSERT)
|
| +#if DCHECK_IS_ON()
|
| static bool s_threadCreated = false;
|
|
|
| bool isAtomicallyInitializedStaticMutexLockHeld() {
|
|
|