Initialize the singleton-vault early in init()
authorYedidya Feldblum <yfeldblum@fb.com>
Fri, 14 Apr 2017 07:22:47 +0000 (00:22 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 14 Apr 2017 07:36:06 +0000 (00:36 -0700)
commita411c5f39eae10019582d3c19375ee8816f2e4ce
treea1cb0da75f99a2d4afce3d258b7179f118b362a3
parenta110f8daa0ad5cca47c5be85cb415d0cd3bd3f57
Initialize the singleton-vault early in init()

Summary:
Initialize the singleton-vault early in `init()` to avoid ordering problems with other parts of `init()`.

Initialization is done by calling `SingletonVault::singleton()->registrationComplete()`. Do that before (almost) everything, in particular, before parsing args and initializing logging.

Note that this just marks it okay for singletons to be instantiated, but does not by itself instantiate any singletons. However, this is useful if, in some way, parsing args or initializing logging should happen to use singletons.

Reviewed By: andriigrynenko

Differential Revision: D4889777

fbshipit-source-id: 6817db22d38a498cd20e361fc574a146029432ec
folly/init/Init.cpp