diff options
| author | Hans Boehm <hboehm@google.com> | 2016-07-29 14:39:10 -0700 |
|---|---|---|
| committer | Hans Boehm <hboehm@google.com> | 2016-08-29 17:45:26 -0700 |
| commit | 1b07c95b74d9d7f339317f1ed3ed09f1018ab77e (patch) | |
| tree | 41848a3da45a6ba73d6372dcbaccd4d9ada31754 /libunwindstack/tests/MemoryLocalTest.cpp | |
| parent | 0c572d01afdf9bfee340ab5c167d744ea91316bf (diff) | |
Fix race bug in attemptIncStrong
The compensating onLastStrongRef call could be made even when there
was no onIncStrongAttempted call to compensate for. This
happened in the OBJECT_LIFETIME_STRONG case when e.g. curCount
was initially zero, but was concurrently incremented by another
thread.
I believe the old code was also incorrect in the
curCount = INITIAL_STRONG_VALUE + 1 case,
which seems to be possible under unlikely conditions.
In that case, I believe the compensating call IS needed.
Thus the condition was also changed.
Clean cherrypick of 7f27cbc3f4583e13a2a48e8148cbdfc0abc43af8 from AOSP.
Bug: 30503444
Change-Id: I44bcbcbb1264e4b52b6d3750dc39b041c4140381
Diffstat (limited to 'libunwindstack/tests/MemoryLocalTest.cpp')
0 files changed, 0 insertions, 0 deletions
