Fixed LICENSE install and self-deadlock in callbacks#41
Conversation
Replaced CMAKE_SOURCE_DIR with CMAKE_CURRENT_SOURCE_DIR when specifying the path to the LICENSE file for installation. Using CMAKE_SOURCE_DIR breaks the installation if this project is included as a subproject (e.g., via add_subdirectory) in a larger CMake build, because it would resolve to the top-level parent project's root directory. CMAKE_CURRENT_SOURCE_DIR ensures the LICENSE file is correctly resolved relative to this specific CMakeLists.txt file. Gh-Issue: #40 Signed-off-by: Andrea Ricchi <andrea.ricchi@amarulasolutions.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughRefactors ChangesManager Callback Locking Refactor
CMake Install Path Fix
Estimated code review effort: 3 (Moderate) | ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
🧩 Build Artifacts ✅ The following build artifacts were produced: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/dbus/gconnman_manager.cpp`:
- Around line 333-340: The TechnologyRemoved branch in connectSignal() is
reading the signal tuple directly instead of its first child, so removals are
not processed correctly. Update the TechnologyRemoved handling in
gconnman_manager.cpp to extract child 0 from parameters before passing it to
g_variant_get_string, while keeping the existing g-signal::TechnologyAdded and
g-signal::TechnologyRemoved comparisons unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a059462a-5649-4272-8e45-17f764fa7048
📒 Files selected for processing (2)
CMakeLists.txtsrc/dbus/gconnman_manager.cpp
|
LGTM. |
on_services_changed_cb, get_proxies_cb and on_technology_added_removed_cb all invoke the user-registered services_changed_cb_/technologies_changed_cb_ while still holding mtx_. If the callback calls back into Manager::services()/technologies() (both of which lock the same non-recursive mtx_), the callback dispatch thread deadlocks on itself. This is easy to hit in practice: a consumer's services-changed handler typically wants to read the current service list, which is the obvious thing to call from inside the callback. Copy the updated list and the callback out under the lock, release the lock, then invoke the callback with the copies. This also means any work the callback does (which we don't control) no longer serializes against unrelated Manager accessors while it runs. Signed-off-by: Andrea Ricchi <andrea.ricchi@amarulasolutions.com>
|
🧩 Build Artifacts ✅ The following build artifacts were produced: |
Summary by CodeRabbit