Skip to content

Commit

Permalink
Manually called Thread.interrupt() to re-interrupt the current thread. (
Browse files Browse the repository at this point in the history
#20)

Calling Thread.interrupt() ensures that the thread will be interrupted
when InterruptedException is caught and will not risk delaying the
thread shutdown or lose the information that the thread was interrupted.

Code Changes:


![image](https://github.com/rilling/OpenTracks-Winter-SOEN-6431_2024/assets/41756221/aa502709-65c7-4301-bf2d-995eb87b144f)
  • Loading branch information
Sharanyu authored Feb 14, 2024
2 parents b6307d8 + 15d0ad1 commit 9532b4a
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public boolean writeTrack(List<Track> tracks, @NonNull OutputStream outputStream
return true;
} catch (InterruptedException | IOException e) {
Log.e(TAG, "Unable to write track", e);
Thread.currentThread().interrupt();
return false;
}
}
Expand Down

0 comments on commit 9532b4a

Please sign in to comment.