Skip to content
Permalink
Browse files

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
  • Loading branch information...
davidaurelio authored and facebook-github-bot committed Jan 31, 2018
1 parent 0009909 commit e7562514130f614a9f138c0b855bfe4516150add
@@ -286,7 +286,7 @@ private static boolean storePlainJSInFile(BufferedSource body, File outputFile)
return true;
}

private boolean storeDeltaInFile(BufferedSource body, File outputFile) throws IOException {
private synchronized boolean storeDeltaInFile(BufferedSource body, File outputFile) throws IOException {

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

0 comments on commit e756251

Please sign in to comment.
You can’t perform that action at this time.