src/hotspot/share/gc/shared/satbMarkQueue.cpp
changeset 59252 623722a6aeb9
parent 59248 e92153ed8bdc
child 59290 97d13893ec3c
equal deleted inserted replaced
59251:4cbfa5077d68 59252:623722a6aeb9
   134   do {
   134   do {
   135     old = value;
   135     old = value;
   136     value += 2;
   136     value += 2;
   137     assert(value > old, "overflow");
   137     assert(value > old, "overflow");
   138     if (value > threshold) value |= 1;
   138     if (value > threshold) value |= 1;
   139     value = Atomic::cmpxchg(value, cfptr, old);
   139     value = Atomic::cmpxchg(cfptr, old, value);
   140   } while (value != old);
   140   } while (value != old);
   141 }
   141 }
   142 
   142 
   143 // Decrement count.  If count == 0, clear flag, else maintain flag.
   143 // Decrement count.  If count == 0, clear flag, else maintain flag.
   144 static void decrement_count(volatile size_t* cfptr) {
   144 static void decrement_count(volatile size_t* cfptr) {
   147   do {
   147   do {
   148     assert((value >> 1) != 0, "underflow");
   148     assert((value >> 1) != 0, "underflow");
   149     old = value;
   149     old = value;
   150     value -= 2;
   150     value -= 2;
   151     if (value <= 1) value = 0;
   151     if (value <= 1) value = 0;
   152     value = Atomic::cmpxchg(value, cfptr, old);
   152     value = Atomic::cmpxchg(cfptr, old, value);
   153   } while (value != old);
   153   } while (value != old);
   154 }
   154 }
   155 
   155 
   156 void SATBMarkQueueSet::set_process_completed_buffers_threshold(size_t value) {
   156 void SATBMarkQueueSet::set_process_completed_buffers_threshold(size_t value) {
   157   // Scale requested threshold to align with count field.  If scaling
   157   // Scale requested threshold to align with count field.  If scaling