summaryrefslogtreecommitdiff
path: root/compiler/compiler_backend.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2013-12-03 14:24:05 -0800
committer Mathieu Chartier <mathieuc@google.com> 2013-12-05 12:57:43 -0800
commit5f51d4b80058236759fea1d932470a57f348c199 (patch)
tree096ce11ba8dc096fd27d2fbed84459080c7d3b1e /compiler/compiler_backend.cc
parentd83d4c86c89357a74e94963994ad0c42ea7299c3 (diff)
Fix races in thread list Unregister.
First race: We were releasing the thin_lock_id in Unregister before the thread was not suspended. This could cause problems in SuspendThreadByThreadId since there was a small window of time where two threads could share the same thread id. This race caused an occasional check failure in SuspendThreadByThreadId. Second race: We were setting the thin_lock_thread_id_ to 0 in Unregister before waiting to not be suspended. This caused another race in SuspendThreadByThreadId where we modified the thread suspend count, busy waited, but didn't find the thread the next iteration. This meant that we were returning null even though we had modified the suspend count. This caused the suspend count to not get decremented since the caller didn't know that the suspend count had been increased. Removing the self->thin_lock_thread_id_ = 0 in ThreadList::UnRegister fixes this race. Added a bit of additional checks and logging to prevent these issues from resurfacing, other misc cleanup. Added thread names to threads in ThreadStress. Bug: 11319866 Change-Id: I48e3a0700193b72079e450be1e924a2f88cf52e2
Diffstat (limited to 'compiler/compiler_backend.cc')
0 files changed, 0 insertions, 0 deletions