Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions source/bulkdata/profilexconf.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:

Check failure on line 3 in source/bulkdata/profilexconf.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'source/bulkdata/profilexconf.c' (Match: rdk/components/generic/telemetry/rdk/components/generic/telemetry/1, 1020 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/telemetry/+archive/RDKB-RELEASE-TEST-DUNFELL-1.tar.gz, file: source/bulkdata/profilexconf.c)
*
* Copyright 2019 RDK Management
*
Expand Down Expand Up @@ -220,6 +220,11 @@
do
{
T2Info("%s while Loop -- START \n", __FUNCTION__);
if(singleProfile == NULL)
{
T2Error("%s is called with empty profile, profile reload might be in-progress, skip the request\n", __FUNCTION__);
goto reportXconfThreadEnd;
}
profile = singleProfile;
Vector *profileParamVals = NULL;
Vector *grepResultList = NULL;
Expand Down Expand Up @@ -498,7 +503,6 @@
//pthread_mutex_unlock(&plMutex);
reportXconfThreadEnd :
T2Info("%s while Loop -- END \n", __FUNCTION__);
T2Info("%s --out\n", __FUNCTION__);
pthread_cond_wait(&reuseThread, &plMutex);
}
while(initialized);
Expand Down Expand Up @@ -596,7 +600,6 @@
pthread_cond_signal(&reuseThread);
pthread_mutex_unlock(&plMutex);
pthread_join(singleProfile->reportThread, NULL);
reportThreadExits = false;
singleProfile->reportInProgress = false ;
T2Info("Final report is completed, releasing profile memory\n");
}
Expand Down Expand Up @@ -731,21 +734,13 @@

if(singleProfile->reportInProgress)
{
T2Info("Waiting for CollectAndReport to be complete : %s\n", singleProfile->name);
pthread_mutex_lock(&plMutex);
initialized = false;
T2Info("Sending signal to reuse Thread in CollectAndReportXconf\n");
pthread_cond_signal(&reuseThread);
pthread_mutex_unlock(&plMutex);
pthread_join(singleProfile->reportThread, NULL);
T2Info("reportThread exits and initialising the profile list\n");
reportThreadExits = false;
initialized = true;
singleProfile->reportInProgress = false ;
T2Info("Waiting for CollectAndReportXconf to be complete : %s\n", singleProfile->name);
}

pthread_mutex_lock(&plMutex);

profile->reportThread = singleProfile->reportThread;

size_t count = Vector_Size(singleProfile->cachedReportList);
// Copy any cached message present in previous single profile to new profile
if(isNameEqual)
Expand Down Expand Up @@ -1013,9 +1008,14 @@

T2ERROR ret = T2ERROR_FAILURE;

pthread_mutex_lock(&plMutex);

if(!singleProfile)
{
T2Error("Xconf profile is not set.\n");

pthread_mutex_unlock(&plMutex);

return ret;
}

Expand Down Expand Up @@ -1043,6 +1043,8 @@
T2Info("No report generation in progress. No further action required for abort.\n");
}

pthread_mutex_unlock(&plMutex);

return ret;

}
Expand Down
Loading