< prev index next >
src/share/vm/utilities/taskqueue.cpp
Print this page
rev 8151 : 6407976: GC worker number should be unsigned
Reviewed-by: jwilhelm
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
@@ -129,11 +129,11 @@
*seed0 = seed;
return seed;
}
ParallelTaskTerminator::
-ParallelTaskTerminator(int n_threads, TaskQueueSetSuper* queue_set) :
+ParallelTaskTerminator(uint n_threads, TaskQueueSetSuper* queue_set) :
_n_threads(n_threads),
_queue_set(queue_set),
_offered_termination(0) {}
bool ParallelTaskTerminator::peek_in_queue_set() {
@@ -152,11 +152,11 @@
bool
ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) {
assert(_n_threads > 0, "Initialization is incorrect");
assert(_offered_termination < _n_threads, "Invariant");
- Atomic::inc(&_offered_termination);
+ Atomic::inc((int *)&_offered_termination);
uint yield_count = 0;
// Number of hard spin loops done since last yield
uint hard_spin_count = 0;
// Number of iterations in the hard spin loop.
@@ -230,11 +230,11 @@
#ifdef TRACESPINNING
_total_peeks++;
#endif
if (peek_in_queue_set() ||
(terminator != NULL && terminator->should_exit_termination())) {
- Atomic::dec(&_offered_termination);
+ Atomic::dec((int *)&_offered_termination);
assert(_offered_termination < _n_threads, "Invariant");
return false;
}
}
}
@@ -263,9 +263,9 @@
return _obj != NULL && _obj->is_objArray() && _index > 0 &&
_index < objArrayOop(_obj)->length();
}
#endif // ASSERT
-void ParallelTaskTerminator::reset_for_reuse(int n_threads) {
+void ParallelTaskTerminator::reset_for_reuse(uint n_threads) {
reset_for_reuse();
_n_threads = n_threads;
}
< prev index next >