Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add synchronized block to protect against race condition (#69)
Summary: Fixes: #60 As mentioned in issue #60 if the init method is called twice from two different threads it can result in a race condition where both threads receive false for `NativeLoader.isInitialized()`, but, when `NativeLoader.init()` is run for a second time it throws an exception. Adding a synchronized block here ensures that only one thread will be able to query the initialisation state and trigger the initialisation at a time. Pull Request resolved: #69 Reviewed By: oprisnik Differential Revision: D25973362 Pulled By: wizh fbshipit-source-id: d340bae2b8891c6f095a2560b37ded50cf20ab67
- Loading branch information