+#ifdef FOLLY_SANITIZE_THREAD
+ // TSAN has a limitation for the number of locks held concurrently, so it's
+ // safer to call useGlobal() serially.
+ if (refCountPtrs.size() > 1) {
+ for (auto refCountPtr : refCountPtrs) {
+ refCountPtr->useGlobal();
+ }
+ return;
+ }
+#endif
+