You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Associated JIRA ticket in format : < JIRA TICKET >: < one line summary of change less than 65 characters >
Detailed reason for change information
Test procedure. Only references links to Jira ticket or sub tickets where test steps and references are captured.
< JIRA TICKET >: < one line summary of change less than 65 characters >
< empty line >
Reason for change:
Test Procedure: < https://ccp.sys.comcast.net/browse/JIRA TICKET/url/to/test_step_section>
This PR replaces per-timer threads with a shared GLib timer-loop thread.
Changes:
Adds shared one-shot and periodic GLib timer scheduling.
Stores GLib source IDs instead of timer thread state.
Updates build dependencies for GLib/GStreamer integration.
File
Summary and review status
common/source/Timer.cpp
Implements shared timer scheduling. Critical issue (2 votes): timer ID publication can race with callback dispatch. Moderate issues (1 vote each): use a private main context and address g_timeout_add_once GLib 2.74 compatibility.
common/include/Timer.h
Updates timer state to use GLib source identifiers.
common/CMakeLists.txt
Adds build dependencies. Nit (1 vote): link directly to glib-2.0 instead of unrelated GStreamer modules.
Coverage statistics of your commit:
Congratulations, your commit improved lines coverage from: 85.0% to 85.1%
Congratulations, your commit improved functions coverage from: 93.4% to 93.5%
Passing nullptr selects GLib's process-wide default GMainContext, and both g_timeout_add calls below attach their sources to that same context. Running it from this worker can contend with or dispatch unrelated default-context sources, and timers may stop firing if another loop owns the context. Use a private context for the shared timer loop and attach each timer source to it.
Clear active state when one-shot timer fires
common/source/Timer.cpp:118
g_timeout_add_once removes the source after this callback, but m_active is never cleared here. Consequently every one-shot timer that fires naturally continues to report isActive() == true until someone explicitly calls cancel(), unlike the previous implementation (which set it false when the thread exited). Clear the active flag after the callback, including when the callback is empty.
Coverage statistics of your commit:
Congratulations, your commit improved lines coverage from: 85.0% to 85.1%
Congratulations, your commit improved functions coverage from: 93.4% to 93.5%
A one-shot timer never transitions m_active to false when its source fires, so isActive() remains true after expiration. This also leaves the timer looking live to callers until destruction; clear the active state and remove the source ID independently of whether a callback is present.
Coverage statistics of your commit:
Congratulations, your commit improved lines coverage from: 84.4% to 85.1%
Congratulations, your commit improved functions coverage from: 92.7% to 93.5%
Coverage statistics of your commit:
Congratulations, your commit improved lines coverage from: 85.0% to 85.1%
Congratulations, your commit improved functions coverage from: 93.4% to 93.5%
Coverage statistics of your commit:
Congratulations, your commit improved lines coverage from: 85.0% to 85.1%
Congratulations, your commit improved functions coverage from: 93.4% to 93.5%
Coverage statistics of your commit:
Lines coverage stays unchanged and is: 84.6%
Functions coverage stays unchanged and is: 92.8%
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RDKEMW-24084: Single thread timer
Reason for change: Do not create a dedicated thread for each timer to improve the performance
Test Procedure: Rialto CI