comparison src/share/vm/gc_implementation/g1/dirtyCardQueue.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 2d160770d2e5
children f95d63e2154a
comparison
equal deleted inserted replaced
1841:32a1f7bf0c21 1842:6e0aac35bfa9
35 35
36 // A ptrQueue whose elements are "oops", pointers to object heads. 36 // A ptrQueue whose elements are "oops", pointers to object heads.
37 class DirtyCardQueue: public PtrQueue { 37 class DirtyCardQueue: public PtrQueue {
38 public: 38 public:
39 DirtyCardQueue(PtrQueueSet* qset_, bool perm = false) : 39 DirtyCardQueue(PtrQueueSet* qset_, bool perm = false) :
40 PtrQueue(qset_, perm) 40 // Dirty card queues are always active, so we create them with their
41 { 41 // active field set to true.
42 // Dirty card queues are always active. 42 PtrQueue(qset_, perm, true /* active */) { }
43 _active = true; 43
44 }
45 // Apply the closure to all elements, and reset the index to make the 44 // Apply the closure to all elements, and reset the index to make the
46 // buffer empty. If a closure application returns "false", return 45 // buffer empty. If a closure application returns "false", return
47 // "false" immediately, halting the iteration. If "consume" is true, 46 // "false" immediately, halting the iteration. If "consume" is true,
48 // deletes processed entries from logs. 47 // deletes processed entries from logs.
49 bool apply_closure(CardTableEntryClosure* cl, 48 bool apply_closure(CardTableEntryClosure* cl,