Mercurial > hg > graal-compiler
comparison src/share/vm/utilities/taskqueue.cpp @ 360:5d254928c888
Merge
author | ysr |
---|---|
date | Wed, 27 Aug 2008 11:20:46 -0700 |
parents | 37f87013dfd8 |
children | 81cd571500b0 |
comparison
equal
deleted
inserted
replaced
341:d60e4e6d7f72 | 360:5d254928c888 |
---|---|
63 | 63 |
64 void ParallelTaskTerminator::sleep(uint millis) { | 64 void ParallelTaskTerminator::sleep(uint millis) { |
65 os::sleep(Thread::current(), millis, false); | 65 os::sleep(Thread::current(), millis, false); |
66 } | 66 } |
67 | 67 |
68 bool ParallelTaskTerminator::offer_termination() { | 68 bool |
69 ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) { | |
69 Atomic::inc(&_offered_termination); | 70 Atomic::inc(&_offered_termination); |
70 | 71 |
71 juint yield_count = 0; | 72 juint yield_count = 0; |
72 while (true) { | 73 while (true) { |
73 if (_offered_termination == _n_threads) { | 74 if (_offered_termination == _n_threads) { |
89 // which may only move the thread to the end of the this processor's | 90 // which may only move the thread to the end of the this processor's |
90 // runqueue). | 91 // runqueue). |
91 sleep(WorkStealingSleepMillis); | 92 sleep(WorkStealingSleepMillis); |
92 } | 93 } |
93 | 94 |
94 if (peek_in_queue_set()) { | 95 if (peek_in_queue_set() || |
96 (terminator != NULL && terminator->should_exit_termination())) { | |
95 Atomic::dec(&_offered_termination); | 97 Atomic::dec(&_offered_termination); |
96 return false; | 98 return false; |
97 } | 99 } |
98 } | 100 } |
99 } | 101 } |