Make sure getService isn't failing if thread is interrupted.
@@ -357,17 +357,28 @@ public class ServiceRegistry
{
holder = usage.m_svcHolderRef.get();
if (holder != null)
+ {
+ boolean interrupted = false;
+ do
{
try
{
// Need to ensure that the other thread has obtained
// the service.
holder.m_latch.await();
+ if (interrupted)
+ {
+ Thread.currentThread().interrupt();
+ }
+ interrupted = false;
}
catch (InterruptedException e)
{
- throw new RuntimeException(e);
+ interrupted = true;
+ Thread.interrupted();
+ }
}
+ while (interrupted);
svcObj = holder.m_service;
}
}
