From 0f9e82dbab89ebb024aea3a16a30162a75059383 Mon Sep 17 00:00:00 2001 From: Petr Chalupa Date: Fri, 29 Jul 2016 21:05:42 +0200 Subject: [PATCH] Revert "Handle properly interruption in Java version of LockableObject" This reverts commit d634acfb0bfa6e17f42861eb3435b1cd7dc3038d. --- ext/com/concurrent_ruby/ext/SynchronizationLibrary.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ext/com/concurrent_ruby/ext/SynchronizationLibrary.java b/ext/com/concurrent_ruby/ext/SynchronizationLibrary.java index fdabe5037..c98f5a0fa 100644 --- a/ext/com/concurrent_ruby/ext/SynchronizationLibrary.java +++ b/ext/com/concurrent_ruby/ext/SynchronizationLibrary.java @@ -189,15 +189,13 @@ public IRubyObject nsWait(ThreadContext context, IRubyObject[] args) { } } if (Thread.interrupted()) { - // do nothing ns_wait is allowed to wake up spuriously - return this; + throw runtime.newConcurrencyError("thread interrupted"); } - boolean success = false; try { success = context.getThread().wait_timeout(this, timeout); } catch (InterruptedException ie) { - // do nothing ns_wait is allowed to wake up spuriously + throw runtime.newConcurrencyError(ie.getLocalizedMessage()); } finally { // An interrupt or timeout may have caused us to miss // a notify that we consumed, so do another notify in