-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Stability enhancemets #7272
Stability enhancemets #7272
Conversation
Change-Id: I5314aee307905ea5801e8b9bed92880739ef8953
Refactoring of error-polling mechanism to stop after device disconnect Change-Id: I0082a9277d05c4c607bf92d527d397328e688f58 Add AO deactivation in dtor for error polling Change-Id: Ie18308ff4536fd40cac8a61d07b7b21c81522723
Change-Id: I476befc583db749f6bbeff9dbaef553bb1c19de3
polling_errors_disable(polling_error_handler* handler) | ||
: _polling_error_handler(handler), _value(1) | ||
polling_errors_disable(std::unique_ptr<polling_error_handler>& handler) | ||
: _polling_error_handler(std::move(handler)), _value(1) |
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.
Not sure I like this: why not make it a shared_ptr<> instead, then we don't run into a situation where the value is now null but there really still is a handler?
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.
The fix addresses only the issue of the polling handler in 'orphan' mode after device is (forcibly) disconnected.
In that case the device is indeed is 0xdeadbeef but the handler remained active and could fail on dereferencing invalid pointer.
With this design the handler will remain intact, and after device disconnects it will stop the active object in dtor.
So the polling events will be handled properly during the period between device disconnect and the dtor call
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.
I also recognize more things to improve in the design of active objects lifetime control but this will require a separate session
src/hw-monitor.cpp
Outdated
{ | ||
return _locked_transfer->send_receive({ details.sendCommandData.begin(),details.sendCommandData.end()}); | ||
} | ||
else |
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.
Can remove the else
clause and keep all the other code unindented
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.
Done.
Change-Id: I89c93e79430a2bda0aa9ad8c5d73811ff9dcfa8e
…llow up on PR IntelRealSense#7272 (cherry picked from commit 78ee0f0) # Conflicts: # src/hdr-config.cpp
No description provided.