Skip to content

vehicle_time: Deliver VehicleClock callbacks from a worker thread - #215

Open
florianfueller wants to merge 1 commit into
eclipse-score:mainfrom
florianfueller:feature/59-vehicle-clock-callback-delivery
Open

florianfueller wants to merge 1 commit into
eclipse-score:mainfrom
florianfueller:feature/59-vehicle-clock-callback-delivery

Conversation

@florianfueller

@florianfueller florianfueller commented Sep 8, 2026

Copy link
Copy Markdown

Improvement

Description

Implement callback delivery in VehicleClockBackendImpl; the Set*/Unset* methods were
no-ops so far.

  • A worker thread, started by the first successful Init(), polls the TimeDaemon shared
    memory every 50 ms while at least one callback is registered and dispatches on that thread.
  • TimeSlaveSyncData / PDelayMeasurementData fire on every changed frame.
  • VehicleTimeStatus fires once after registration, then only when the flags change
    (rate deviation excluded).
  • Subscribe / Unsubscribe are safe against in-flight invocations, including calls from
    inside a callback.
  • Unit tests added; docs and comments updated, "not yet delivered" warnings removed.

Related ticket

closes #59 (improvement ticket)

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: e47efd82-2490-4335-9f44-727f06ac8e2e
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'platforms', the root module requires module version platforms@1.0.0, but got platforms@1.1.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'score_platform', the root module requires module version score_platform@0.7.1, but got score_platform@0.7.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_oci', the root module requires module version rules_oci@2.2.7, but got rules_oci@2.3.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 3 packages loaded
WARNING: Target pattern parsing failed.
ERROR: Skipping '//:license-check': no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/time/time/BUILD
ERROR: no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/time/time/BUILD
INFO: Elapsed time: 14.987s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

@florianfueller
florianfueller force-pushed the feature/59-vehicle-clock-callback-delivery branch from d4f4e67 to 143d1fb Compare September 9, 2026 07:57
@florianfueller
florianfueller force-pushed the feature/59-vehicle-clock-callback-delivery branch from 143d1fb to d447876 Compare September 9, 2026 11:18
@florianfueller
florianfueller force-pushed the feature/59-vehicle-clock-callback-delivery branch from d447876 to a816147 Compare September 9, 2026 12:37
@florianfueller
florianfueller marked this pull request as ready for review September 9, 2026 12:38
@florianfueller
florianfueller force-pushed the feature/59-vehicle-clock-callback-delivery branch from c811e27 to 041c9b8 Compare September 23, 2026 06:56
@florianfueller
florianfueller force-pushed the feature/59-vehicle-clock-callback-delivery branch from 041c9b8 to 4448f49 Compare September 23, 2026 07:42
@florianfueller
florianfueller force-pushed the feature/59-vehicle-clock-callback-delivery branch from 4448f49 to 756eaad Compare September 23, 2026 08:06
@florianfueller
florianfueller force-pushed the feature/59-vehicle-clock-callback-delivery branch from 756eaad to 28b62ff Compare September 23, 2026 08:32
Implement callback delivery in VehicleClockBackendImpl; the Set and
Unset methods were no-ops so far.

- SvtCallbackDispatcher owns a worker thread that polls the TimeDaemon
  shared memory every 50 ms and dispatches on that thread. Init()
  enables dispatching; the thread is started once the first callback
  is registered and runs until the backend is destroyed. While no
  callback is registered it sleeps until the next registration.
- SvtCallbackWrapper holds one callback and detects changes: it
  remembers the key of the last delivered value and forgets it on
  Set/Unset, so every newly registered callback receives the next
  frame and afterwards only changes.
- TimeSlaveSyncData and PDelayMeasurementData fire on every changed
  frame.
- VehicleTimeStatus fires once after registration, then only when the
  flags change (rate deviation excluded).
- Subscribe and Unsubscribe are safe against in-flight invocations,
  including calls from inside a callback; the callback runs under the
  wrapper's recursive mutex, which provides the Set/Unset guarantees.
- Add unit tests, update docs and comments, remove the "not yet
  delivered" warnings.

Refs eclipse-score#59

Signed-off-by: Florian Füller <5454068+florianfueller@users.noreply.github.com>
@florianfueller
florianfueller force-pushed the feature/59-vehicle-clock-callback-delivery branch from 28b62ff to f0a646e Compare September 23, 2026 09:19

This branch is waiting to be deployed

1 waiting deployment
workflow-approval f0a646e8 Waiting Sep 23, 2026 by florianfueller via qnx-build (x86_64-qnx) / approval #802
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Improvement: Implement the callbacks envoking

1 participant