-
Notifications
You must be signed in to change notification settings - Fork 22
[WIP] Address feedback on locking access to CameraZoomConfig #894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: maerki <6221466+maerki@users.noreply.github.com>
Co-authored-by: maerki <6221466+maerki@users.noreply.github.com>
There was a problem hiding this 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 |
Copilot
AI
Dec 10, 2025
There was a problem hiding this comment.
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.
getCameraVerticalDisplacement()andgetCameraPitch()updateZoom()to call the unlocked versions directly💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.