hotspot/src/share/vm/memory/freeList.cpp
changeset 27251 7d667f91ec8d
parent 26422 4ee5901e205e
child 27684 e0391b2bf625
--- a/hotspot/src/share/vm/memory/freeList.cpp	Mon Oct 20 10:18:17 2014 +0200
+++ b/hotspot/src/share/vm/memory/freeList.cpp	Tue Oct 21 11:57:22 2014 +0200
@@ -287,11 +287,14 @@
   return false;
 }
 
-#ifndef PRODUCT
+#ifdef ASSERT
 template <class Chunk>
 void FreeList<Chunk>::assert_proper_lock_protection_work() const {
-  assert(protecting_lock() != NULL, "Don't call this directly");
-  assert(ParallelGCThreads > 0, "Don't call this directly");
+  // Nothing to do if the list has no assigned protecting lock
+  if (protecting_lock() == NULL) {
+    return;
+  }
+
   Thread* thr = Thread::current();
   if (thr->is_VM_thread() || thr->is_ConcurrentGC_thread()) {
     // assert that we are holding the freelist lock