src/hotspot/share/utilities/concurrentHashTable.inline.hpp
changeset 50608 1609a43e77ae
parent 50445 bd6b78feb6a3
child 50637 359607017fb7
--- a/src/hotspot/share/utilities/concurrentHashTable.inline.hpp	Mon Jun 18 14:36:50 2018 +0200
+++ b/src/hotspot/share/utilities/concurrentHashTable.inline.hpp	Mon Jun 18 16:13:21 2018 +0200
@@ -484,11 +484,12 @@
 template <typename EVALUATE_FUNC, typename DELETE_FUNC>
 inline void ConcurrentHashTable<VALUE, CONFIG, F>::
   do_bulk_delete_locked_for(Thread* thread, size_t start_idx, size_t stop_idx,
-                            EVALUATE_FUNC& eval_f, DELETE_FUNC& del_f)
+                            EVALUATE_FUNC& eval_f, DELETE_FUNC& del_f, bool is_mt)
 {
   // Here we have resize lock so table is SMR safe, and there is no new
   // table. Can do this in parallel if we want.
-  assert(_resize_lock_owner == thread, "Re-size lock not held");
+  assert((is_mt && _resize_lock_owner != NULL) ||
+         (!is_mt && _resize_lock_owner == thread), "Re-size lock not held");
   Node* ndel[BULK_DELETE_LIMIT];
   InternalTable* table = get_table();
   assert(start_idx < stop_idx, "Must be");
@@ -516,7 +517,11 @@
     bucket->lock();
     size_t nd = delete_check_nodes(bucket, eval_f, BULK_DELETE_LIMIT, ndel);
     bucket->unlock();
-    write_synchonize_on_visible_epoch(thread);
+    if (is_mt) {
+      GlobalCounter::write_synchronize();
+    } else {
+      write_synchonize_on_visible_epoch(thread);
+    }
     for (size_t node_it = 0; node_it < nd; node_it++) {
       del_f(ndel[node_it]->value());
       Node::destroy_node(ndel[node_it]);