< prev index next >

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

Print this page
rev 11970 : imported patch workgroup_volatiles

*** 470,496 **** bool SequentialSubTasksDone::valid() { return _n_threads > 0; } bool SequentialSubTasksDone::is_task_claimed(uint& t) { ! uint* n_claimed_ptr = &_n_claimed; ! t = *n_claimed_ptr; while (t < _n_tasks) { ! jint res = Atomic::cmpxchg(t+1, n_claimed_ptr, t); if (res == (jint)t) { return false; } ! t = *n_claimed_ptr; } return true; } bool SequentialSubTasksDone::all_tasks_completed() { ! uint* n_completed_ptr = &_n_completed; ! uint complete = *n_completed_ptr; while (true) { ! uint res = Atomic::cmpxchg(complete+1, n_completed_ptr, complete); if (res == complete) { break; } complete = res; } --- 470,494 ---- bool SequentialSubTasksDone::valid() { return _n_threads > 0; } 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; } bool SequentialSubTasksDone::all_tasks_completed() { ! uint complete = *(&_n_completed); while (true) { ! uint res = Atomic::cmpxchg(complete+1, &_n_completed, complete); if (res == complete) { break; } complete = res; }
< prev index next >