Wait for some time if Singleton isn't destroyed immediately
authorAndrii Grynenko <andrii@fb.com>
Wed, 28 Jan 2015 04:09:27 +0000 (20:09 -0800)
committerAndrew Cox <andrewcox@fb.com>
Wed, 4 Feb 2015 20:58:50 +0000 (12:58 -0800)
commit32ab0252eb4d382896575ba2ae69f8ac41030005
treee4656030858f3d22489403d6650088315661d3a7
parent4bffc7589f7bb66aa8ab0dbf1e5d39840daf6121
Wait for some time if Singleton isn't destroyed immediately

Summary: This diff introduces 5 seconds wait time to let other threads release Singleton which may be temporarily locked. This helps prevent most of "Singleton object alive after destruction" warnings in cases where weak_ptr API is used correctly. Abusive use of folly::Singletons, where dependencies between singletons are not properly defined will still cause a warning.

Test Plan: unit test

Reviewed By: chip@fb.com

Subscribers: trunkagent, folly-diffs@

FB internal diff: D1808371

Signature: t1:1808371:1422487261:573eb40b6a260e428d96be476659335250c7ea76
folly/experimental/Singleton.cpp
folly/experimental/Singleton.h
folly/experimental/test/SingletonTest.cpp