Merge "ShellSubscriber: Avoid rollover bug" into rvc-dev am: f1d96d48f6

Change-Id: I4011ff9e00985c4d8e0ba0605f8b347a5b78659d
This commit is contained in:
TreeHugger Robot
2020-03-23 17:54:24 +00:00
committed by Automerger Merge Worker
2 changed files with 2 additions and 2 deletions

View File

@@ -41,7 +41,7 @@ void ShellSubscriber::startNewSubscription(int in, int out, int timeoutSec) {
// critical-section // critical-section
std::unique_lock<std::mutex> lock(mMutex); std::unique_lock<std::mutex> lock(mMutex);
if (myToken < mToken) { if (myToken != mToken) {
// Some other subscription has already come in. Stop. // Some other subscription has already come in. Stop.
return; return;
} }

View File

@@ -108,7 +108,7 @@ private:
std::shared_ptr<SubscriptionInfo> mSubscriptionInfo = nullptr; std::shared_ptr<SubscriptionInfo> mSubscriptionInfo = nullptr;
int mToken; int mToken = 0;
}; };
} // namespace statsd } // namespace statsd