Skip to content

combine shared data function - #13941

Merged
Nir-Az merged 2 commits into
realsenseai:developmentfrom
Noy-Zini:fix-static-analysis-issue
Apr 29, 2025
Merged

Nir-Az merged 2 commits into
realsenseai:developmentfrom
Noy-Zini:fix-static-analysis-issue

Conversation

@Noy-Zini

Copy link
Copy Markdown
Contributor

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
Comment thread common/output-model.cpp Outdated
void frame_drops_dashboard::process_frame(rs2::frame f)
{
write_shared_data([&](){
shared_data_access::write_shared_data([&](){

Copy link
Copy Markdown
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?

@Noy-Zini Noy-Zini Apr 29, 2025 •

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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
Copy Markdown
Contributor 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 realsenseai:development Apr 29, 2025
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