Wait for helper thread to finish in MonitorContendedEntered test

In testMonitorContendedEnteredForClassMatch, we have main thread and a
helper thread contending on the same monitor. We make sure that there is
contention by waiting on the main thread till the helper thread is in
blocked state before releasing the lock. Though it is possible that we
exit since main thread finishes before the helper thread gets a lock.
This CL makes the main thread wait for the helper thread to finish.

Bug: 142039794
Test: org.apache.harmony.jpda.tests.jdwp.Events_MonitorContendedEnteredTest#testMonitorContendedEnteredForClassMatch
Change-Id: I430afe5372c3fea53bfd7c53e4047c57565edfa8
1 file changed