Use RWSpinLock for Singleton mutex
authorAndrii Grynenko <andrii@fb.com>
Fri, 26 Sep 2014 02:02:37 +0000 (19:02 -0700)
committerDave Watson <davejwatson@fb.com>
Tue, 30 Sep 2014 23:15:54 +0000 (16:15 -0700)
commit4833e0ef95b46a9b6afd9bd712dc0aca63d9077e
treea023ab39ac7d08129cab4885eea9d8c4a26c5864
parent23d9f0ec3e82fab12760bee8ae5f2abca526e120
Use RWSpinLock for Singleton mutex

Summary: We only need exclusive lock when we add items to singletons_. Each SingletonEntry has its own mutex, so it's safe to rely on it for any modifications within individual entries.

Test Plan: Applied D1573880 and ran fbconfig -r servicerouter/client/cpp2 && fbmake runtests

Reviewed By: chip@fb.com

Subscribers: trunkagent, njormrod, hitesh, mshneer

FB internal diff: D1579877
folly/experimental/Singleton.cpp
folly/experimental/Singleton.h