harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Li Jing Qin (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-6575) [drlvm]Thread.interrupt should wake up the blocking select
Date Fri, 09 Jul 2010 05:56:51 GMT
[drlvm]Thread.interrupt should wake up the blocking select
----------------------------------------------------------

                 Key: HARMONY-6575
                 URL: https://issues.apache.org/jira/browse/HARMONY-6575
             Project: Harmony
          Issue Type: Bug
         Environment: harmony + drlvm
            Reporter: Li Jing Qin


Given the test case below, harmony + drlvm seems hang on linux 32 platform.

public class PipeChannelTest {
	static class MyRunnable implements Runnable {
		private SelectableChannel channel;
		
		public MyRunnable (SelectableChannel channel) throws Exception {
			this.channel = channel;
			this.channel.configureBlocking(false);
		}
		
		@Override
		public void run() {
			try {
				Selector sel = Selector.open();
				channel.register(sel, SelectionKey.OP_READ);
				sel.select(0);
			} catch (Exception e) {
				e.printStackTrace();
				System.out.println("Should throw exception.");
			}
		}
		
	}
	
	public static void main(String[] args) throws Exception {
		Pipe pipe = Pipe.open();
		Pipe.SourceChannel source = pipe.source();
		
		Thread thread = new Thread(new MyRunnable(source));
		thread.start();
		Thread.sleep(1000);
		
		System.out.println("interrupt");
		thread.interrupt();
		
		try {
			thread.join();
		} catch (InterruptedException e) {}
		
		System.out.println("Is open: " + source.isOpen());
		if (source.isOpen()) {
			source.close();
		}
	}
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message