Skip to content

Commit ca00e9b

Browse files
committed
RDKTV-33096: Wpeframework crash with signature RDKShell::subscribeForSystemEvent
Reason for change: adding lock-unlock in RDKShell::subscribeForSystemEvent() for proper synchronization Test Procedure: as specified in RDKTV-33096 Risks: Low Priority: P1 Signed-off-by:Boopathi Vanavarayan <[email protected]> Change-Id: I5a88ff61e351d3fd537bfe5906edea485bff9967
1 parent 49ce949 commit ca00e9b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

RDKShell/RDKShell.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -947,9 +947,7 @@ namespace WPEFramework {
947947
}
948948
else if (requestName.compare("susbscribeSystemEvent") == 0)
949949
{
950-
gSubscribeMutex.lock();
951950
subscribeForSystemEvent("onSystemPowerStateChanged");
952-
gSubscribeMutex.unlock();
953951
std::cout << "subscribed system event " << std::endl;
954952
JsonObject joGetParams;
955953
JsonObject joGetResult;
@@ -8165,6 +8163,7 @@ namespace WPEFramework {
81658163

81668164
int32_t RDKShell::subscribeForSystemEvent(std::string event)
81678165
{
8166+
gSubscribeMutex.lock();
81688167
int32_t status = Core::ERROR_GENERAL;
81698168

81708169
PluginHost::IShell::state state;
@@ -8204,7 +8203,7 @@ namespace WPEFramework {
82048203
}
82058204
else
82068205
std::cout << "No Connection to SystemServices" << std::endl;
8207-
8206+
gSubscribeMutex.unlock();
82088207
return status;
82098208
}
82108209

0 commit comments

Comments
 (0)