Merge "ShellSubscriber: Avoid rollover bug" into rvc-dev am: f1d96d48f6
Change-Id: I4011ff9e00985c4d8e0ba0605f8b347a5b78659d
This commit is contained in:
@@ -41,7 +41,7 @@ void ShellSubscriber::startNewSubscription(int in, int out, int timeoutSec) {
|
||||
|
||||
// critical-section
|
||||
std::unique_lock<std::mutex> lock(mMutex);
|
||||
if (myToken < mToken) {
|
||||
if (myToken != mToken) {
|
||||
// Some other subscription has already come in. Stop.
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ private:
|
||||
|
||||
std::shared_ptr<SubscriptionInfo> mSubscriptionInfo = nullptr;
|
||||
|
||||
int mToken;
|
||||
int mToken = 0;
|
||||
};
|
||||
|
||||
} // namespace statsd
|
||||
|
||||
Reference in New Issue
Block a user