rvesse commented on issue #3535: URL: https://github.com/apache/jena/issues/3535#issuecomment-3496294677
Your main gotcha on checking `Thread.interrupted()` is that checking clears the flag (see https://docs.oracle.com/javase/tutorial/essential/concurrency/interrupt.html): > When a thread checks for an interrupt by invoking the static method Thread.interrupted, interrupt status is cleared So if one iterator checks the flag and it returns `true` any other iterator checking it subsequently would receive a `false` result. Thus this is only viable if the first iterator that checks the flag is capable of aborting the entire iterator tree There's also other ways in which the interrupt flag can get cleared, e.g. methods throwing an `InterruptedException`, so I think you'd find it hard to reliably use this as a signal to all the iterators that might be open during query execution -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
