Ensure ThreadPool constructor does not return until fully initialized.
Thread pool was being deleted too early during runtime shutdown,
this was causing a GC running during runtime shutdown to
occasionally reference a deleted thread pool.
Fixed an error where the thread pool was being deleted before the
threads were done attaching by making the thread pool constructor
block until all of the threads are attached.
Change-Id: I5f0884a74d78c4541ee0e582112857077f3f594f
diff --git a/src/gc/mark_sweep.cc b/src/gc/mark_sweep.cc
index 0976f94..d6c44db 100644
--- a/src/gc/mark_sweep.cc
+++ b/src/gc/mark_sweep.cc
@@ -85,7 +85,7 @@
classes_marked_(0), overhead_time_(0),
work_chunks_created_(0), work_chunks_deleted_(0),
reference_count_(0),
- gc_barrier_(new Barrier),
+ gc_barrier_(new Barrier(0)),
large_object_lock_("large object lock"),
mark_stack_expand_lock_("mark stack expand lock") {
DCHECK(mark_stack_ != NULL);