Changed ConstructorCallback to work with -Wglobal-constructor
Summary: The initial implementation of ConstructorCallback used a global (pre-main) initialization which was deemed safe. While likely still safe, it turns out that when trying to land diffs that used ConstructorCallback, many code bases compile with -Wglobal-constructor which explicitly denies this type of initialization (even if it is safe). Re-worked the code to prevent any non-zero initialization and still maintain the property that we don't lock unless someone is registering a callback. Reviewed By: bschlinker Differential Revision: D28395301 fbshipit-source-id: 2cdd82189410b3ccea1c892560d0d0cb5b6abc34
Showing
Please register or sign in to comment