Skip to content

Commit

Permalink
Expose isInitialized function for SoLoader
Browse files Browse the repository at this point in the history
Summary: Expose isInitialized function for SoLoader

Reviewed By: kevinfrei

Differential Revision: D20559686

fbshipit-source-id: b71b8b939648de3c50cbc26d378b5183c143da31
  • Loading branch information
hkj-i authored and facebook-github-bot committed Mar 20, 2020
1 parent f8eaf3e commit 21071b4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions java/com/facebook/soloader/SoLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -926,11 +926,15 @@ public static String makeNonZipPath(final String localLdLibraryPath) {
}

private static void assertInitialized() {
if (!isInitialized()) {
throw new RuntimeException("SoLoader.init() not yet called");
}
}

public static boolean isInitialized() {
sSoSourcesLock.readLock().lock();
try {
if (sSoSources == null) {
throw new RuntimeException("SoLoader.init() not yet called");
}
return sSoSources != null;
} finally {
sSoSourcesLock.readLock().unlock();
}
Expand Down

0 comments on commit 21071b4

Please sign in to comment.