Replaced call to system with call to cin.get.

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@1153 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
rich_sposato 2011-10-17 20:00:02 +00:00
parent 034ebb042c
commit ac16c24fb5

View file

@ -1,12 +1,12 @@
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Test program for The Loki Library // Test program for The Loki Library
// Copyright (c) 2006 Richard Sposato // Copyright (c) 2006 Richard Sposato
// Permission to use, copy, modify, distribute and sell this software for any // Permission to use, copy, modify, distribute and sell this software for any
// purpose is hereby granted without fee, provided that the above copyright // purpose is hereby granted without fee, provided that the above copyright
// notice appear in all copies and that both that copyright notice and this // notice appear in all copies and that both that copyright notice and this
// permission notice appear in supporting documentation. // permission notice appear in supporting documentation.
// The authors make no representations about the // The authors make no representations about the
// suitability of this software for any purpose. It is provided "as is" // suitability of this software for any purpose. It is provided "as is"
// without express or implied warranty. // without express or implied warranty.
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -425,18 +425,23 @@ void * Run( void * id )
void DoLockedPtrTest( void ) void DoLockedPtrTest( void )
{ {
cout << "Doing thread-locked pointer tests." << endl; char ender;
SafeA::GetIt(); SafeA::GetIt();
UnsafeA::GetIt(); UnsafeA::GetIt();
::system( "pause" ); cout << "Doing thread-locked pointer tests." << endl;
cout << "Press <Enter> key to start test. " << endl;
cin.get( ender );
{ {
ThreadPool pool; ThreadPool pool;
pool.Create( 5, RunLocked ); pool.Create( 5, RunLocked );
pool.Start(); pool.Start();
pool.Join(); pool.Join();
} }
cout << "Doing thread-unsafe pointer tests." << endl; cout << "Doing thread-unsafe pointer tests." << endl;
::system( "pause" ); cout << "Press <Enter> key to start test. " << endl;
cin.get( ender );
{ {
ThreadPool pool; ThreadPool pool;
pool.Create( 5, Run ); pool.Create( 5, Run );
@ -451,22 +456,25 @@ void DoLockedPtrTest( void )
void DoLockedStorageTest( void ) void DoLockedStorageTest( void )
{ {
cout << "Doing LockedStorage tests." << endl; char ender;
SelfLockedA::GetIt(); SelfLockedA::GetIt();
::system( "pause" ); cout << "Doing LockedStorage tests." << endl;
cout << "Press <Enter> key to start test. " << endl;
cin.get( ender );
{ {
ThreadPool pool; ThreadPool pool;
pool.Create( 5, RunLockedStorage ); pool.Create( 5, RunLockedStorage );
pool.Start(); pool.Start();
pool.Join(); pool.Join();
} }
::system( "pause" ); cout << "Press <Enter> key when ready. " << endl;
cin.get( ender );
SelfLockedA::Destroy(); SelfLockedA::Destroy();
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#endif //#ifdef using multi-threaded model #endif //#ifdef using multi-threaded model
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------