--- old/src/hotspot/share/runtime/thread.cpp 2018-12-09 03:18:58.402640859 -0500 +++ new/src/hotspot/share/runtime/thread.cpp 2018-12-09 03:18:58.018620523 -0500 @@ -306,15 +306,19 @@ } #endif // ASSERT - // Notify the barrier set that a thread is being created. Note that some - // threads are created before a barrier set is available. The call to - // BarrierSet::on_thread_create() for these threads is therefore deferred + // Notify the barrier set that a thread is being created. The initial + // thread is created before the barrier set is available. The call to + // BarrierSet::on_thread_create() for this thread is therefore deferred // to BarrierSet::set_barrier_set(). BarrierSet* const barrier_set = BarrierSet::barrier_set(); if (barrier_set != NULL) { barrier_set->on_thread_create(this); } else { - DEBUG_ONLY(Threads::inc_threads_before_barrier_set();) +#ifdef ASSERT + static bool initial_thread_created = false; + assert(!initial_thread_created, "creating thread before barrier set"); + initial_thread_created = true; +#endif // ASSERT } } @@ -3395,7 +3399,6 @@ #ifdef ASSERT bool Threads::_vm_complete = false; -size_t Threads::_threads_before_barrier_set = 0; #endif static inline void *prefetch_and_load_ptr(void **addr, intx prefetch_interval) {