In cocos2d-x v3.16, UserDefault is a singleton class. The implementation of this singleton is below:
UserDefault* UserDefault::getInstance()
{
if (! _userDefault)
{
#ifdef KEEP_COMPATABILITY
initXMLFilePath();
#endif
_userDefault = new (std::nothrow) UserDefault();
}return _userDefault;
}
is it ensure thread safe?