Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: JRuby 1.3
-
Fix Version/s: None
-
Component/s: Java Integration
-
Labels:None
-
Environment:all
-
Testcase included:yes
-
Number of attachments :
Description
public void testInturruptingRubyInstance() throws Exception
{
Thread thread = new Thread(){
public void run()
};
thread.start();
long before = System.currentTimeMillis();
thread.interrupt();
thread.join();
long millis = System.currentTimeMillis() - before;
assertEquals(("ruby ignored interrupt for " + millis + " millis."), true, millis < 2000);
}
[11:50am] MenTaLguY: either you propagate the exception, or else you remember the interrupt state and re-interrupt the thread after you wake up
[11:51am] enebo: MenTaLguY: Well that is something which seems reasonable but it does not match Ruby semantics in this case right?
[11:55am] enebo: micahmartin: It seems we should have a way from Java to deliver a user-supplied interrupt to a Ruby thread and have it not get eaten
[11:55am] micahmartin: I'd agree... shall I submit a ticket?
[11:55am] enebo: It is unfortunate that sleep and interrupt/wait all use the same exception
[11:56am] enebo: micahmartin: yeah for sure....I am not sure how we will attack this, but we need to keep track of it
[11:56am] enebo: wait=notify in above sentence