Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-raise swallowed interrupts and log warnings for spurious #195

Merged
merged 1 commit into from
May 30, 2018

Conversation

jpd236
Copy link
Collaborator

@jpd236 jpd236 commented May 30, 2018

interrupts.

Volley relies on a quit() method and mQuit flag on both dispatcher
threads to shut down those threads. These could just use the interrupt
state instead, but as noted on #60, these are public, non-final
classes, and so relying on interrupt depends on external callers and
subclasses using the interrupt state correctly.

To be more conservative and retain existing behavior, we keep the quit
method/flag around to ensure that we only shut down the dispatchers
when quit() is called. However, we re-raise the interrupt flag in this
case. If we're interrupted outside of quit(), we suppress the
interrupt flag and log a warning instead.

Fixes #60

interrupts.

Volley relies on a quit() method and mQuit flag on both dispatcher
threads to shut down those threads. These could just use the interrupt
state instead, but as noted on google#60, these are public, non-final
classes, and so relying on interrupt depends on external callers and
subclasses using the interrupt state correctly.

To be more conservative and retain existing behavior, we keep the quit
method/flag around to ensure that we only shut down the dispatchers
when quit() is called. However, we re-raise the interrupt flag in this
case. If we're interrupted outside of quit(), we suppress the
interrupt flag and log a warning instead.

Fixes google#60
@jpd236 jpd236 requested a review from jjoslin May 30, 2018 22:30
@jpd236 jpd236 merged commit 0c32d6a into google:master May 30, 2018
@jpd236 jpd236 deleted the finish-threads branch May 30, 2018 22:37
@jpd236 jpd236 mentioned this pull request May 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants