< prev index next >

src/share/vm/gc/shared/workgroup.cpp

Print this page
rev 13450 : imported patch fix_calls
rev 13471 : imported patch copyrights

*** 1,7 **** /* ! * Copyright (c) 2001, 2016, 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. --- 1,7 ---- /* ! * Copyright (c) 2001, 2017, 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.
*** 426,436 **** bool SubTasksDone::is_task_claimed(uint t) { assert(t < _n_tasks, "bad task id."); uint old = _tasks[t]; if (old == 0) { ! old = Atomic::cmpxchg(1, &_tasks[t], 0); } assert(_tasks[t] == 1, "What else?"); bool res = old != 0; #ifdef ASSERT if (!res) { --- 426,436 ---- bool SubTasksDone::is_task_claimed(uint t) { assert(t < _n_tasks, "bad task id."); uint old = _tasks[t]; if (old == 0) { ! old = Atomic::cmpxchg(1u, &_tasks[t], 0u); } assert(_tasks[t] == 1, "What else?"); bool res = old != 0; #ifdef ASSERT if (!res) {
*** 440,458 **** #endif return res; } void SubTasksDone::all_tasks_completed(uint n_threads) { ! jint observed = _threads_completed; ! jint old; do { old = observed; observed = Atomic::cmpxchg(old+1, &_threads_completed, old); } while (observed != old); // If this was the last thread checking in, clear the tasks. uint adjusted_thread_count = (n_threads == 0 ? 1 : n_threads); ! if (observed + 1 == (jint)adjusted_thread_count) { clear(); } } --- 440,458 ---- #endif return res; } void SubTasksDone::all_tasks_completed(uint n_threads) { ! uint observed = _threads_completed; ! uint old; do { old = observed; observed = Atomic::cmpxchg(old+1, &_threads_completed, old); } while (observed != old); // If this was the last thread checking in, clear the tasks. uint adjusted_thread_count = (n_threads == 0 ? 1 : n_threads); ! if (observed + 1 == adjusted_thread_count) { clear(); } }
*** 472,483 **** } bool SequentialSubTasksDone::is_task_claimed(uint& t) { t = _n_claimed; while (t < _n_tasks) { ! jint res = Atomic::cmpxchg(t+1, &_n_claimed, t); ! if (res == (jint)t) { return false; } t = res; } return true; --- 472,483 ---- } bool SequentialSubTasksDone::is_task_claimed(uint& t) { t = _n_claimed; while (t < _n_tasks) { ! uint res = Atomic::cmpxchg(t+1, &_n_claimed, t); ! if (res == t) { return false; } t = res; } return true;
< prev index next >