The code is taken directly from Dr. K's book. Mutex class creates two threads: Pusher and Popper.
MY QUESTION: The output of the code is: Exit from main(). Pushed: true Popped: null What I can't understand is why is popped null. First, I thought maybe because the JVM did a context switch in the middle of incrementing toOfStack, but then I put in System.out statements and there was no context switch during ++topOfStack.
Here is the code:
Joined: Jun 10, 2004
the smiley face shouldn't be there: the for loop is an infinite loop.