SingleStateQueue: Add last method to Mutator

Obtains last value written.

Test: see bug for CL topic and test
Bug: 80272001
Change-Id: Ia71752970ac2e66bb1c89cd9e06691fc88f64647
gugelfrei
Andy Hung 6 years ago
parent 40e34f6fe6
commit 59fef32845

@ -99,6 +99,13 @@ private:
return mShared->mAck - sequence >= 0;
}
// returns the last value written (or the contents of the shared buffer after initialization
// if no value was written).
T last() const
{ // assume no sequence check required - we are the writer.
return mShared->mValue;
}
private:
int32_t mSequence;
Shared * const mShared;

Loading…
Cancel
Save