Skip to content

combine shared data function #13941

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

Merged
merged 2 commits into from
Apr 29, 2025

Conversation

Noy-Zini
Copy link

I refactored the write_shared_data and read_shared_data functions, which were previously used separately in both the output-model and graph-model class, by creating a new class that contains these functions for shared use.

@Noy-Zini Noy-Zini requested a review from Nir-Az April 15, 2025 08:12
@@ -1204,7 +1204,7 @@ void stream_dashboard::draw_dashboard(ux_window& win, rect& r)

void frame_drops_dashboard::process_frame(rs2::frame f)
{
write_shared_data([&](){
shared_data_access::write_shared_data([&](){
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not rs::utils it?
With some UT maybe :)
another question can't we set the mute in the class construction and not send it on each action?

Copy link
Author

@Noy-Zini Noy-Zini Apr 29, 2025

Choose a reason for hiding this comment

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

Added under rsutils/concurrency/shared-data-access and changed the functionality to set the mutex in the class construction.

// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2025 Intel Corporation. All Rights Reserved.
#pragma once
#include <mutex>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add all needed includes this file use from std.
I see for example
std::function

Copy link
Author

Choose a reason for hiding this comment

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

You're right I added it, thanks

@Noy-Zini Noy-Zini force-pushed the fix-static-analysis-issue branch from 0d5c8c4 to 771bf0e Compare April 29, 2025 14:48
@Nir-Az Nir-Az merged commit 58931ae into IntelRealSense:development Apr 29, 2025
25 of 26 checks passed
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