✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Teniendo el siguiente monitor que usan 3 hilos (H1, H2 y H3) en paralelo:public class SynchronizedCounter {private int c = 0;public synchronized void sumar(){ c++;}public synchronized void restar(){ if (c==0) { wait(); } c--;}}Y sabiendo que el hilo principal ha hecho join a la espera de que los tres hilos terminen, que c vale 0, que el hilo H1 ha ejecutado el método restar() y que H3 tiene el monitor mientras ejecuta la línea "c++;" de sumar(), ¿Qué valor tendrá c cuando acaben todos los hilos?
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!