novitski / bitcoinj

Automatically exported from code.google.com/p/bitcoinj
Apache License 2.0
0 stars 0 forks source link

Payment channels NioWrapper code uses interrupt() #436

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
To shutdown the ProtoBufServer handler thread, interrupt() is used. That's 
unsafe. Thread interrupts aren't a hugely useful mechanism because 
InterruptedException can be thrown and caught/swallowed more or less anywhere 
in a large codebase. A better solution is to forcibly close the selector. Then 
if there's currently a thread blocked inside select() it will be woken up, and 
if a thread is somewhere else at the time, it'll realise it's time to go when 
it reaches the select loop again.

Original issue reported on code.google.com by hearn@google.com on 7 Aug 2013 at 2:33

GoogleCodeExporter commented 9 years ago
Fixed on nonetty, which hopefully makes it into 0.11
https://code.google.com/r/bluemattme-bitcoinj/source/detail?r=577ec8804015a2c5ba
cc8e1baa514cb2edef0f37&name=nonetty

Original comment by BlueMatt...@gmail.com on 7 Aug 2013 at 2:45

GoogleCodeExporter commented 9 years ago

Original comment by hearn@google.com on 12 Dec 2013 at 3:07