comparison src/share/vm/gc_implementation/g1/satbQueue.hpp @ 1842:6e0aac35bfa9

6980838: G1: guarantee(false) failed: thread has an unexpected active value in its SATB queue Summary: Under certain circumstances a safepoint could happen between a JavaThread object being created and that object being added to the Java threads list. This could cause the active field of that thread's SATB queue to get out-of-sync with respect to the other Java threads. The solution is to activate the SATB queue, when necessary, before adding the thread to the Java threads list, not when the JavaThread object is created. The changeset also includes a small fix to rename the surrogate locker thread from "Surrogate Locker Thread (CMS)" to "Surrogate Locker Thread (Concurrent GC)" since it's also used in G1. Reviewed-by: iveresov, ysr, johnc, jcoomes
author tonyp
date Fri, 01 Oct 2010 16:43:05 -0400
parents c18cbe5936b8
children f95d63e2154a
comparison
equal deleted inserted replaced
1841:32a1f7bf0c21 1842:6e0aac35bfa9
27 27
28 // A ptrQueue whose elements are "oops", pointers to object heads. 28 // A ptrQueue whose elements are "oops", pointers to object heads.
29 class ObjPtrQueue: public PtrQueue { 29 class ObjPtrQueue: public PtrQueue {
30 public: 30 public:
31 ObjPtrQueue(PtrQueueSet* qset_, bool perm = false) : 31 ObjPtrQueue(PtrQueueSet* qset_, bool perm = false) :
32 PtrQueue(qset_, perm, qset_->is_active()) { } 32 // SATB queues are only active during marking cycles. We create
33 // them with their active field set to false. If a thread is
34 // created during a cycle and its SATB queue needs to be activated
35 // before the thread starts running, we'll need to set its active
36 // field to true. This is done in JavaThread::initialize_queues().
37 PtrQueue(qset_, perm, false /* active */) { }
33 // Apply the closure to all elements, and reset the index to make the 38 // Apply the closure to all elements, and reset the index to make the
34 // buffer empty. 39 // buffer empty.
35 void apply_closure(ObjectClosure* cl); 40 void apply_closure(ObjectClosure* cl);
36 41
37 // Apply the closure to all elements of "buf", down to "index" (inclusive.) 42 // Apply the closure to all elements of "buf", down to "index" (inclusive.)