diff options
author | Sebastian Schmidt <mrschmidt@google.com> | 2018-01-05 10:34:38 -0800 |
---|---|---|
committer | Sebastian Schmidt <mrschmidt@google.com> | 2018-01-05 10:34:38 -0800 |
commit | ed6c6f9fea3e1e429972cbd0e65f3fc7c05e41e2 (patch) | |
tree | 8247e9786c78841e987a8199960ec245e32a8833 /Firestore/Source/API | |
parent | 275b4e5a7633d69b6de36551398e88943dca8432 (diff) |
Fixing potential race in ServerTimestamp tests
Diffstat (limited to 'Firestore/Source/API')
-rw-r--r-- | Firestore/Source/API/FIRFirestore.m | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Firestore/Source/API/FIRFirestore.m b/Firestore/Source/API/FIRFirestore.m index b455726..9df3711 100644 --- a/Firestore/Source/API/FIRFirestore.m +++ b/Firestore/Source/API/FIRFirestore.m @@ -158,14 +158,14 @@ NSString *const FIRFirestoreErrorDomain = @"FIRFirestoreErrorDomain"; } - (FIRFirestoreSettings *)settings { - @synchronized (self) { + @synchronized(self) { // Disallow mutation of our internal settings return [_settings copy]; } } - (void)setSettings:(FIRFirestoreSettings *)settings { - @synchronized (self) { + @synchronized(self) { // As a special exception, don't throw if the same settings are passed repeatedly. This should // make it more friendly to create a Firestore instance. if (_client && ![_settings isEqual:settings]) { @@ -187,17 +187,17 @@ NSString *const FIRFirestoreErrorDomain = @"FIRFirestoreErrorDomain"; } - (void)ensureClientConfigured { - @synchronized (self) { + @synchronized(self) { if (!_client) { // These values are validated elsewhere; this is just double-checking: FSTAssert(_settings.host, @"FirestoreSettings.host cannot be nil."); FSTAssert(_settings.dispatchQueue, @"FirestoreSettings.dispatchQueue cannot be nil."); FSTDatabaseInfo *databaseInfo = - [FSTDatabaseInfo databaseInfoWithDatabaseID:_databaseID - persistenceKey:_persistenceKey - host:_settings.host - sslEnabled:_settings.sslEnabled]; + [FSTDatabaseInfo databaseInfoWithDatabaseID:_databaseID + persistenceKey:_persistenceKey + host:_settings.host + sslEnabled:_settings.sslEnabled]; FSTDispatchQueue *userDispatchQueue = [FSTDispatchQueue queueWith:_settings.dispatchQueue]; @@ -280,7 +280,7 @@ NSString *const FIRFirestoreErrorDomain = @"FIRFirestoreErrorDomain"; - (void)shutdownWithCompletion:(nullable void (^)(NSError *_Nullable error))completion { FSTFirestoreClient *client; - @synchronized (self) { + @synchronized(self) { client = _client; _client = nil; } |