From ac16c24fb5776742e842b7d4c445910f78f8ca7f Mon Sep 17 00:00:00 2001 From: rich_sposato Date: Mon, 17 Oct 2011 20:00:02 +0000 Subject: [PATCH] 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 --- test/SmartPtr/LockTest.cpp | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/test/SmartPtr/LockTest.cpp b/test/SmartPtr/LockTest.cpp index 963c5f7..9816c15 100644 --- a/test/SmartPtr/LockTest.cpp +++ b/test/SmartPtr/LockTest.cpp @@ -1,12 +1,12 @@ //////////////////////////////////////////////////////////////////////////////// // Test program for The Loki Library // Copyright (c) 2006 Richard Sposato -// Permission to use, copy, modify, distribute and sell this software for any -// purpose is hereby granted without fee, provided that the above copyright -// notice appear in all copies and that both that copyright notice and this +// Permission to use, copy, modify, distribute and sell this software for any +// purpose is hereby granted without fee, provided that the above copyright +// notice appear in all copies and that both that copyright notice and this // permission notice appear in supporting documentation. -// The authors make no representations about the -// suitability of this software for any purpose. It is provided "as is" +// The authors make no representations about the +// suitability of this software for any purpose. It is provided "as is" // without express or implied warranty. //////////////////////////////////////////////////////////////////////////////// @@ -425,18 +425,23 @@ void * Run( void * id ) void DoLockedPtrTest( void ) { - cout << "Doing thread-locked pointer tests." << endl; + char ender; + SafeA::GetIt(); UnsafeA::GetIt(); - ::system( "pause" ); + cout << "Doing thread-locked pointer tests." << endl; + cout << "Press key to start test. " << endl; + cin.get( ender ); { ThreadPool pool; pool.Create( 5, RunLocked ); pool.Start(); pool.Join(); } + cout << "Doing thread-unsafe pointer tests." << endl; - ::system( "pause" ); + cout << "Press key to start test. " << endl; + cin.get( ender ); { ThreadPool pool; pool.Create( 5, Run ); @@ -451,22 +456,25 @@ void DoLockedPtrTest( void ) void DoLockedStorageTest( void ) { - cout << "Doing LockedStorage tests." << endl; + char ender; SelfLockedA::GetIt(); - ::system( "pause" ); + cout << "Doing LockedStorage tests." << endl; + cout << "Press key to start test. " << endl; + cin.get( ender ); { ThreadPool pool; pool.Create( 5, RunLockedStorage ); pool.Start(); pool.Join(); } - ::system( "pause" ); + cout << "Press key when ready. " << endl; + cin.get( ender ); SelfLockedA::Destroy(); } // ---------------------------------------------------------------------------- -#endif //#ifdef using multi-threaded model +#endif //#ifdef using multi-threaded model // ----------------------------------------------------------------------------