Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 4, 2025

  • Create private unlocked helper versions of getCameraVerticalDisplacement() and getCameraPitch()
  • Update updateZoom() to call the unlocked versions directly
  • Keep the public methods that acquire the lock for external callers
  • Build and test the changes

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 4, 2025 13:55
Co-authored-by: maerki <6221466+maerki@users.noreply.github.com>
Co-authored-by: maerki <6221466+maerki@users.noreply.github.com>
@maerki maerki marked this pull request as ready for review December 10, 2025 08:55
Copilot AI review requested due to automatic review settings December 10, 2025 08:55
@maerki maerki merged commit a8a3734 into bugfix/lock-all-config-acces Dec 10, 2025
@maerki maerki deleted the copilot/sub-pr-893 branch December 10, 2025 08:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors camera parameter access to improve thread safety by introducing private unlocked helper methods for getCameraVerticalDisplacement() and getCameraPitch(). This allows updateZoom() to call these methods without redundant locking since it already holds the paramMutex, while keeping the public methods that acquire the lock for external callers.

  • Created private unlocked helper methods to avoid double-locking when already holding paramMutex
  • Updated updateZoom() to use the unlocked versions directly
  • Maintained thread-safe public interfaces that acquire locks for external callers

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
shared/src/map/camera/MapCamera3d.h Added private unlocked helper method declarations with documentation; removed fieldOfView member variable (appears unrelated to locking changes)
shared/src/map/camera/MapCamera3d.cpp Implemented unlocked helper methods and refactored public methods to delegate to them; updated updateZoom() to use unlocked versions


Coord focusPointPosition;
double cameraVerticalDisplacement = 0.0;
double cameraPitch = 0; // looking up or down
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fieldOfView member variable has been removed, but this doesn't appear to be related to the locking changes described in the PR. The method getCameraFieldOfView() returns a constant value (42), so this member was likely unused. However, if this deletion is intentional, it should be mentioned in the PR description. If unintentional, the line should be restored.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants