Deprecate get_weak()
authorAndrii Grynenko <andrii@fb.com>
Thu, 26 Nov 2015 20:33:16 +0000 (12:33 -0800)
committerfacebook-github-bot-0 <folly-bot@fb.com>
Thu, 26 Nov 2015 21:20:20 +0000 (13:20 -0800)
commit19fb62bd3fa370bcecd3fac46910718e3871aec6
tree0b43649be217c68b4aed5d2bfe817d9bd7a86d43
parentf0a9aafc8048ea62866c26ef6623834c7824ea4c
Deprecate get_weak()

Summary: get_weak() is always used with .lock(), but try_get() is actually more performant than get_weak().lock().
Using get_weak() to store a weak_ptr and keep locking is not safe in fork scenarios.

Reviewed By: yfeldblum

Differential Revision: D2694223

fb-gh-sync-id: 908d44293ffd9b3782152d43e28d5de172d1654a
folly/Singleton.h
folly/test/SingletonTest.cpp