Backed out changeset 450c187cbc1b (bug 1085727)

This commit is contained in:
Carsten "Tomcat" Book 2014-10-24 12:32:03 +02:00
parent e9928211b7
commit 5984fec600

View File

@ -318,11 +318,25 @@ class MutexBase
DISALLOW_COPY_AND_ASSIGN(MutexBase);
public:
MutexBase() { InitializeCriticalSection(&mCS); }
~MutexBase() { DeleteCriticalSection(&mCS); }
MutexBase()
{
InitializeCriticalSection(&mCS);
}
void Lock() { EnterCriticalSection(&mCS); }
void Unlock() { LeaveCriticalSection(&mCS); }
~MutexBase()
{
DeleteCriticalSection(&mCS);
}
void Lock()
{
EnterCriticalSection(&mCS);
}
void Unlock()
{
LeaveCriticalSection(&mCS);
}
};
#else
@ -337,10 +351,20 @@ class MutexBase
DISALLOW_COPY_AND_ASSIGN(MutexBase);
public:
MutexBase() { pthread_mutex_init(&mMutex, nullptr); }
MutexBase()
{
pthread_mutex_init(&mMutex, nullptr);
}
void Lock() { pthread_mutex_lock(&mMutex); }
void Unlock() { pthread_mutex_unlock(&mMutex); }
void Lock()
{
pthread_mutex_lock(&mMutex);
}
void Unlock()
{
pthread_mutex_unlock(&mMutex);
}
};
#endif
@ -370,7 +394,10 @@ public:
MutexBase::Unlock();
}
bool IsLocked() { return mIsLocked; }
bool IsLocked()
{
return mIsLocked;
}
};
// This lock must be held while manipulating global state, such as
@ -382,8 +409,14 @@ class AutoLockState
DISALLOW_COPY_AND_ASSIGN(AutoLockState);
public:
AutoLockState() { gStateLock->Lock(); }
~AutoLockState() { gStateLock->Unlock(); }
AutoLockState()
{
gStateLock->Lock();
}
~AutoLockState()
{
gStateLock->Unlock();
}
};
class AutoUnlockState
@ -391,8 +424,14 @@ class AutoUnlockState
DISALLOW_COPY_AND_ASSIGN(AutoUnlockState);
public:
AutoUnlockState() { gStateLock->Unlock(); }
~AutoUnlockState() { gStateLock->Lock(); }
AutoUnlockState()
{
gStateLock->Unlock();
}
~AutoUnlockState()
{
gStateLock->Lock();
}
};
//---------------------------------------------------------------------------
@ -455,7 +494,10 @@ public:
return mBlockIntercepts = false;
}
bool InterceptsAreBlocked() const { return mBlockIntercepts; }
bool InterceptsAreBlocked() const
{
return mBlockIntercepts;
}
};
/* static */ Thread*
@ -501,7 +543,10 @@ public:
class StringTable
{
public:
StringTable() { (void)mSet.init(64); }
StringTable()
{
(void)mSet.init(64);
}
const char*
Intern(const char* aString)
@ -553,11 +598,13 @@ private:
class StringAlloc
{
public:
static char* copy(const char* aString)
static char*
copy(const char* aString)
{
return InfallibleAllocPolicy::strdup_(aString);
}
static void free(char* aString)
static void
free(char* aString)
{
InfallibleAllocPolicy::free_(aString);
}