Ornamental Garden - program
Ornamental Garden - program
Counter people_ = new Counter();
Turnstile west_ = new Turnstile(people_);
Turnstile east_ = new Turnstile(people_);
west_.start();
east_.start();
Run the demonstration program -
Demo
It can be seen that after starting the demonstration program, letting it run for a while and then stopping it that the value for the Counter is not the sum of the counts displayed for the East and West turnstiles. Counter increments have been lost - why?