diff options
| author | Hans Boehm <hboehm@google.com> | 2016-07-29 14:39:10 -0700 |
|---|---|---|
| committer | Hans Boehm <hboehm@google.com> | 2016-07-29 14:39:10 -0700 |
| commit | bdf685b695155f9d8290deca0e3022e823c82e2b (patch) | |
| tree | 3dbd1995c23b18f78ccf44e918eb0ca87bf82f88 /libutils/Unicode.cpp | |
| parent | 57a534e255d097f770e803413aedd770a6f5fcf7 (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.
Bug: 30503444
Change-Id: I44bcbcbb1264e4b52b6d3750dc39b041c4140381
Diffstat (limited to 'libutils/Unicode.cpp')
0 files changed, 0 insertions, 0 deletions
