-
Notifications
You must be signed in to change notification settings - Fork 19
Code cleanup prior to queue replacement #50
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
Code cleanup prior to queue replacement #50
Conversation
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.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
@willmmiles : can you please rebase on main ? We had a standing PR that I have merged this morning to be able to work in esp-idf without Arudino. So there are now a little conflict to solve, sorry... We should be able to merge this cleanup PR after because there is no design change (I quickly went through the code but will do it more deeply once rebased). Thanks a lot for your work! |
The previous code tried to implement move-as-copy semantics, which can lead to unexpected behavior; and further it was not safe, as there was a risk of race conditions with the LwIP thread. Remove the unsafe function for now, and indicate to the compiler to check for it. If there's a strong need for a move operation in the future, the thread safety can be reviewed at that time.
Use a recursion-safe guard class for managing the LwIP lock. This will allow some improvements to reduce code duplication.
Use a friend class to ensure that private callbacks are not exposed to client code.
be4f196
to
d3e5501
Compare
@willmmiles : fyi @me-no-dev will be able to have a look today or Friday. |
This is the first part of a replacment series for #21, consisting of removing unsafe interfaces and some internal cleanup prior to the queue structure change.