A little cleanup. Moved class to SmartPtr.cpp and SmartPtr.h files.

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@1110 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
rich_sposato 2011-09-20 22:34:24 +00:00
parent 80a07d19e8
commit 16094ffe39
16 changed files with 450 additions and 344 deletions

View file

@ -48,6 +48,8 @@ typedef ::Loki::LevelMutex< ::Loki::SpinLevelMutex, 1,
void SingleThreadSimpleTest( void )
{
cout << "Starting SingleThreadSimpleTest." << endl;
const unsigned int priorLevel = GetCurrentThreadsLevel();
const unsigned int priorLockCount = CountLocksInCurrentThread();
const unsigned int priorMutexCount = CountMutexesInCurrentThread();
@ -171,6 +173,8 @@ void SingleThreadSimpleTest( void )
assert( okay );
okay = ( CountMutexesAtCurrentLevel() == priorLevelMutexCount );
assert( okay );
cout << "Finished SingleThreadSimpleTest." << endl;
}
// ----------------------------------------------------------------------------
@ -178,6 +182,8 @@ void SingleThreadSimpleTest( void )
void SingleThreadReentrantTest( void )
{
cout << "Starting SingleThreadReentrantTest." << endl;
const unsigned int priorLevel = GetCurrentThreadsLevel();
const unsigned int priorLockCount = CountLocksInCurrentThread();
const unsigned int priorMutexCount = CountMutexesInCurrentThread();
@ -283,6 +289,8 @@ void SingleThreadReentrantTest( void )
assert( okay );
okay = ( CountMutexesAtCurrentLevel() == priorLevelMutexCount );
assert( okay );
cout << "Finished SingleThreadReentrantTest." << endl;
}
// ----------------------------------------------------------------------------
@ -290,6 +298,8 @@ void SingleThreadReentrantTest( void )
void SingleThreadSimpleMultiLockTest( void )
{
cout << "Starting SingleThreadSimpleMultiLockTest." << endl;
const unsigned int priorLevel = GetCurrentThreadsLevel();
const unsigned int priorLockCount = CountLocksInCurrentThread();
const unsigned int priorMutexCount = CountMutexesInCurrentThread();
@ -481,6 +491,8 @@ void SingleThreadSimpleMultiLockTest( void )
assert( okay );
okay = ( CountMutexesAtCurrentLevel() == priorLevelMutexCount );
assert( okay );
cout << "Finished SingleThreadSimpleMultiLockTest." << endl;
}
// ----------------------------------------------------------------------------
@ -488,6 +500,8 @@ void SingleThreadSimpleMultiLockTest( void )
void SingleThreadExceptionTest( void )
{
cout << "Starting SingleThreadExceptionTest." << endl;
const unsigned int priorLevel = GetCurrentThreadsLevel();
const unsigned int priorLockCount = CountLocksInCurrentThread();
const unsigned int priorMutexCount = CountMutexesInCurrentThread();
@ -636,6 +650,8 @@ void SingleThreadExceptionTest( void )
assert( okay );
okay = ( CountMutexesAtCurrentLevel() == priorLevelMutexCount );
assert( okay );
cout << "Finished SingleThreadExceptionTest." << endl;
}
// ----------------------------------------------------------------------------
@ -660,6 +676,7 @@ int main( int argc, const char * const argv[] )
MultiThreadSimpleTest();
MultiThreadTryLockTest();
cout << "main 679" << endl;
MultiThreadReentrantTest();
MultiThreadMultiLockTest();
MultiThreadRandomMultiLockTest();