Skip to content

Commit 162664a

Browse files
authored
Merge pull request #6667 from getsentry/no/java-552-restore-interrupts
fix(ndk): Keep the interrupt when SentryNdk waits for native libraries (JAVA-552)
2 parents 4c4848a + 9f9c390 commit 162664a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎sentry-android-ndk/src/main/java/io/sentry/android/ndk/SentryNdk.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ public static void init(
101101
throw new IllegalStateException("Timeout waiting for Sentry NDK library to load");
102102
}
103103
} catch (InterruptedException e) {
104+
// we don't own the calling thread, so keep its interrupt for the code that does
105+
Thread.currentThread().interrupt();
104106
throw new IllegalStateException(
105107
"Thread interrupted while waiting for NDK libs to be loaded", e);
106108
}
@@ -116,6 +118,8 @@ public static void close() {
116118
throw new IllegalStateException("Timeout waiting for Sentry NDK library to load");
117119
}
118120
} catch (InterruptedException e) {
121+
// we don't own the calling thread, so keep its interrupt for the code that does
122+
Thread.currentThread().interrupt();
119123
throw new IllegalStateException(
120124
"Thread interrupted while waiting for NDK libs to be loaded", e);
121125
}

0 commit comments

Comments
 (0)