RFR: 8210119: Rename SubTasksDone::is_task_claimed

coleen.phillimore at oracle.com coleen.phillimore at oracle.com
Wed Aug 29 11:01:09 UTC 2018


Am I reading this right:

-bool SequentialSubTasksDone::is_task_claimed(uint& t) {
+bool SequentialSubTasksDone::try_claim_task(uint& t) {
    t = _n_claimed;
    while (t < _n_tasks) {
      uint res = Atomic::cmpxchg(t+1, &_n_claimed, t);
      if (res == t) {
- return false;
+ return true;
      }
      t = res;
    }
- return true;
+ return false;
  }


is_task_claimed returned false if the task was claimed?  Oh, yeah, 
that's what the comment in workgroup.hpp says. wow.

http://cr.openjdk.java.net/~kbarrett/8210119/open.00/src/hotspot/share/runtime/safepoint.cpp.udiff.html

Yes, please, this makes much more sense!

Looks good.  I tried to check all the reversals of sense and all there. 
Thanks,
Coleen

On 8/28/18 8:55 PM, Kim Barrett wrote:
> [Sending to hotspot-dev because, though this is a GC utility, it's also
> being used in runtime/safepoint.cpp.]
>
> Please review this small API naming cleanup.
>
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8210119
>
> Webrev:
> http://cr.openjdk.java.net/~kbarrett/8210119/open.00/
>
> Testing:
> mach5 tier1-3
>



More information about the hotspot-dev mailing list