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

Change-Id: I974438d3b45cfb6d8b1d5b60a6dc5dd527704498
This commit is contained in:
TreeHugger Robot
2020-03-23 18:36:43 +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
std::unique_lock<std::mutex> lock(mMutex);
if (myToken < mToken) {
if (myToken != mToken) {
// Some other subscription has already come in. Stop.
return;
}

View File

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