Merge "libprocessgroup: Deliberately leak TaskProfiles and CgroupMap instances."
This commit is contained in:
commit
b552c4ad9a
2 changed files with 8 additions and 4 deletions
|
|
@ -336,8 +336,10 @@ CgroupMap::~CgroupMap() {
|
||||||
}
|
}
|
||||||
|
|
||||||
CgroupMap& CgroupMap::GetInstance() {
|
CgroupMap& CgroupMap::GetInstance() {
|
||||||
static CgroupMap instance;
|
// Deliberately leak this object to avoid a race between destruction on
|
||||||
return instance;
|
// process exit and concurrent access from another thread.
|
||||||
|
static auto* instance = new CgroupMap;
|
||||||
|
return *instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CgroupMap::LoadRcFile() {
|
bool CgroupMap::LoadRcFile() {
|
||||||
|
|
|
||||||
|
|
@ -284,8 +284,10 @@ bool TaskProfile::ExecuteForTask(int tid) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskProfiles& TaskProfiles::GetInstance() {
|
TaskProfiles& TaskProfiles::GetInstance() {
|
||||||
static TaskProfiles instance;
|
// Deliberately leak this object to avoid a race between destruction on
|
||||||
return instance;
|
// process exit and concurrent access from another thread.
|
||||||
|
static auto* instance = new TaskProfiles;
|
||||||
|
return *instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskProfiles::TaskProfiles() {
|
TaskProfiles::TaskProfiles() {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue