mirror of
https://github.com/google/app-check
synced 2026-11-09 22:05:52 +05:45
857 B
857 B
Review Guidelines
Concurrency & Thread Safety
When reviewing Objective-C code, particularly test fakes, you MUST strictly enforce the following thread safety rules for concurrent test execution:
- State Mutation Synchronization: All state mutations (e.g., incrementing counters like
counter++, setting properties, or adding to arrays) MUST be wrapped in a@synchronized(self)block to prevent data races and TSAN (Thread Sanitizer) failures. - Proper Use of
atomicvsnonatomic: Theatomicproperty modifier does NOT make read-modify-write operations (like++) thread-safe. Properties that require compound operations should be declarednonatomicto avoid misleading expectations, and their getters/setters must be manually synchronized in the implementation file (or accessed directly via ivar within a synchronized block).