Skip to content

Commit e756251

Browse files
davidaureliofacebook-github-bot
authored andcommitted
Synchronize map access
Summary: We want applying deltas to be an atomic operation, from incrementing the delta message ID to updating the relevant maps. This is a simple approach to synchronize the corrsponding method. We will probably need to go with a more sophisticated approach, that makes sure that deltas are applied in order. That would also allow us to lock only on writes. Reviewed By: kathryngray Differential Revision: D6846560 fbshipit-source-id: 175a80b4e39223883e397d75e20109fc12a2a878
1 parent 0009909 commit e756251

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ReactAndroid/src/main/java/com/facebook/react/devsupport/BundleDownloader.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ private static boolean storePlainJSInFile(BufferedSource body, File outputFile)
286286
return true;
287287
}
288288

289-
private boolean storeDeltaInFile(BufferedSource body, File outputFile) throws IOException {
289+
private synchronized boolean storeDeltaInFile(BufferedSource body, File outputFile) throws IOException {
290290

291291
JsonReader jsonReader = new JsonReader(new InputStreamReader(body.inputStream()));
292292

0 commit comments

Comments
 (0)