142 os::sleep(Thread::current(), millis, false); |
142 os::sleep(Thread::current(), millis, false); |
143 } |
143 } |
144 |
144 |
145 bool |
145 bool |
146 ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) { |
146 ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) { |
|
147 assert(_n_threads > 0, "Initialization is incorrect"); |
147 assert(_offered_termination < _n_threads, "Invariant"); |
148 assert(_offered_termination < _n_threads, "Invariant"); |
148 Atomic::inc(&_offered_termination); |
149 Atomic::inc(&_offered_termination); |
149 |
150 |
150 uint yield_count = 0; |
151 uint yield_count = 0; |
151 // Number of hard spin loops done since last yield |
152 // Number of hard spin loops done since last yield |