Github user shroman commented on the issue:
https://github.com/apache/incubator-rocketmq/pull/68
I also think that using `synchronized` fits well here.
But I would do it in the following way:
1. Make `serviceState` volatile
```java
private volatile ServiceState serviceState;
```
2. Synchronize only blocks that needs to be atomic (possibly making
synchronized methods -- current huge `start` chunk of code doesn't look nice)
And, of course, provide comments to public methods ;)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---