@@ -25,6 +25,7 @@ public class Client {
2525
2626 // this AtomicLong is used to keep track of the current # of running threads
2727 private static AtomicLong runningThreads = new AtomicLong (0 );
28+ private static boolean benchmark = false ;
2829
2930 public static void main (String [] args ) {
3031 int menuSelection = 0 ;
@@ -50,6 +51,7 @@ else while (menuSelection != 8) {
5051 // if 7, ask which command should be run in the benchmark mode
5152 // and how many connections to create
5253 if (menuSelection == 7 ) {
54+ benchmark = true ;
5355 menuSelection = benchmarkMenu ();
5456 numProcesses = numProcessesMenu ();
5557 }
@@ -62,7 +64,7 @@ else while (menuSelection != 8) {
6264 // make a new thread, tell it the hostname to connect to
6365 // and the command to run. It is also passed the totalTime object,
6466 // so it can record how much time its command took to complete
65- thrd = new Thread (new ClientThread (args [0 ], menuSelection , totalTime , ( numProcesses == 1 ) , runningThreads ));
67+ thrd = new Thread (new ClientThread (args [0 ], menuSelection , totalTime , benchmark , runningThreads ));
6668 thrd .start (); // start the thread
6769 list .add (thrd ); // add the thread to the end of the linked list
6870
0 commit comments