Commit 41739784 authored by Mathieu Chartier's avatar Mathieu Chartier
Browse files

Only allow one requestGC at a time

Fixes possible deadlock caused by Thread.getAllStackTraces

Thread.getAllStackTraces suspends all of the threads. If one of
the threads is a thread which holds the GC daemon lock then we
may deadlock when we allocate the stack trace. This happens if we
get a concurrent GC request when we are allocating the stack trace
elements. To fix the deadlock we now only allow a single thread to
requestGC at the same time.

Credits: yamauchi, hboehm

Bug: 18661622

(cherry picked from commit c0b55b80)

Change-Id: Iba46cb9c6cd2503d7af3348b4478c8c53973b9ee
parent 522855c6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment