Fix potential synchronization issue
Merge pull request #12 from adamwy/master

Fix potential synchronization issue
Implement Thread.interrupt() support.