This repository was archived by the owner on Aug 11, 2023. It is now read-only.
rosnode kill support (shut down the node)#291
Open
wmlynar wants to merge 1 commit intorosjava:kineticfrom
Open
rosnode kill support (shut down the node)#291wmlynar wants to merge 1 commit intorosjava:kineticfrom
wmlynar wants to merge 1 commit intorosjava:kineticfrom
Conversation
|
Thanks for the contribution @wmlynar! |
jubeira
suggested changes
Mar 28, 2019
| private final TopicParticipantManager topicParticipantManager; | ||
| private final ParameterManager parameterManager; | ||
| private final TcpRosServer tcpRosServer; | ||
| private final DefaultNode defaultNode; |
There was a problem hiding this comment.
I'd suggest changing to Node instead of tying this to a particular implementation.
As we only need the shutdown method, we can use the base interface instead.
| shutdownStarted = false; | ||
| } | ||
|
|
||
| // TODO(damonkohler): This should also shut down the Node. |
| if (shutdownStarted) { | ||
| return; | ||
| } | ||
| shutdownStarted = true; |
There was a problem hiding this comment.
About thread safety:
if shutdown is called a second time after the if statement is processed but before shutdownStarted is set to true, it will be called twice.
To be completely sure, I'd suggest placing all the code in both shutdown and start in a synchronized block using a dummy object as the lock. E.g.:
// In the constructor:
shutdownLock = new Object();
// Then:
@Override
public void shutdown() {
synchronized(shutdownLock) {
// current code goes here
}
}And the same for start.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request is intended to resolve issue #289