Skip to content
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

[Documentation] Correct comments around ScheduleLambda to indicate it is thread safe #26538

Closed
lucicop opened this issue May 12, 2023 · 0 comments · Fixed by #33967
Closed

[Documentation] Correct comments around ScheduleLambda to indicate it is thread safe #26538

lucicop opened this issue May 12, 2023 · 0 comments · Fixed by #33967

Comments

@lucicop
Copy link
Contributor

lucicop commented May 12, 2023

Documentation issues

In SystemLayer.h, documentation around ScheduleLambda declaration indicates that it is not thread safe and it should be called only from CHIP context. Yet, our analysis (attached) indicates there are no such issues with ScheduleLambda. To be further checked and if it confirms, to update documentation.

Platform

core (please add to version below)

Anything else?

ScheduleLambda_Audit.pdf

tcarmelveilleux added a commit to tcarmelveilleux/connectedhomeip that referenced this issue Jun 18, 2024
Problem:
- SystemLayer::ScheduleLambda is critical to allow correct
  context updates to data, but it was claimed it had to be
  executed in Matter context already, which is the opposite
  of the point of the method.

Fixes project-chip#26538

This PR:
- Improves the documentation of several methods in SystemLayer.h
- Makes ScheduleLambdaBridge private (not called elsewhere)
- Adds a static assert to avoid arguments on the lambda

Testing done:
- All unit tests still pass
@mergify mergify bot closed this as completed in #33967 Jun 18, 2024
@mergify mergify bot closed this as completed in b6e1a48 Jun 18, 2024
diogopintodsr pushed a commit to diogopintodsr/connectedhomeip that referenced this issue Jun 20, 2024
* Improve documentation of ScheduleLambda

Problem:
- SystemLayer::ScheduleLambda is critical to allow correct
  context updates to data, but it was claimed it had to be
  executed in Matter context already, which is the opposite
  of the point of the method.

Fixes project-chip#26538

This PR:
- Improves the documentation of several methods in SystemLayer.h
- Makes ScheduleLambdaBridge private (not called elsewhere)
- Adds a static assert to avoid arguments on the lambda

Testing done:
- All unit tests still pass

* Restyled by clang-format

---------

Co-authored-by: Restyled.io <commits@restyled.io>
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 a pull request may close this issue.

1 participant