class AccessControl {
public:
static AccessControl& GetInstance() {
- static AccessControl instance;
+ thread_local AccessControl instance;
return instance;
}
// the underlying databases. This is especially the case since the same mappings can end up
// being retrieved several times.
using MappedPrivilegeCache = std::map<std::string, std::vector<std::string>>;
- static MappedPrivilegeCache mapped_privilege_cache;
+ thread_local MappedPrivilegeCache mapped_privilege_cache;
std::string api_version;
PlatformResult res = common::tools::GetPkgApiVersion(&api_version);
// Local cache of API version string. This can be expensive to retrieve from
// underlying databases and this routine can be called many times during
// application launch.
+
+ // TODO: don't use PID to identify the application when getting
+ // API version (since Tizen 6.5 web service apps share PID)
static std::string cached_api_version;
static int cached_pid = -1;
};
bool IsStoragePrivilegeCheckNeeded() {
- static RequestStoragePrivilegeChecker checker{};
+ thread_local RequestStoragePrivilegeChecker checker{};
return checker.isStorageAccessCheckNeeded;
}