DirtyCardQueueSet::mut_process_buffer uses a FreeIdSet to obtain a temporary worker id for the mutator thread. There's some complexity to deal with possibly already having an associated id. However, that complexity is all wasted code, since that situation never arises.
The only use of JavaThread::get_claimed_par_id is here. The only uses of JavaThread::set_claimed_par_id are here. There are no other uses of the underlying JavaThread::_claimed_par_id. That field is initialized to UINT_MAX.
If, on entry to mut_process_buffer, the thread's claimed id is UINT_MAX then the already_claimed case doesn't apply, and an attempt to allocate a new id will be made, with the result recorded in the field. [It used to be that the allocation could fail, returning UINT_MAX in that case. In the present code, allocation never fails, but this analysis doesn't care about that distinction.]
If an id was allocated, buffer processing occurs. Then, the id is released and the thread field reset to UINT_MAX, unless in the already_claimed case.
So if the thread's recorded id was initially UINT_MAX, it will be reset to that value. Since UINT_MAX is the initial value,
So there is no need for the already_claimed flag. Nor is there any need for the JavaThread::_claimed_par_id field.
The only use of JavaThread::get_claimed_par_id is here. The only uses of JavaThread::set_claimed_par_id are here. There are no other uses of the underlying JavaThread::_claimed_par_id. That field is initialized to UINT_MAX.
If, on entry to mut_process_buffer, the thread's claimed id is UINT_MAX then the already_claimed case doesn't apply, and an attempt to allocate a new id will be made, with the result recorded in the field. [It used to be that the allocation could fail, returning UINT_MAX in that case. In the present code, allocation never fails, but this analysis doesn't care about that distinction.]
If an id was allocated, buffer processing occurs. Then, the id is released and the thread field reset to UINT_MAX, unless in the already_claimed case.
So if the thread's recorded id was initially UINT_MAX, it will be reset to that value. Since UINT_MAX is the initial value,
So there is no need for the already_claimed flag. Nor is there any need for the JavaThread::_claimed_par_id field.
- relates to
-
JDK-8141123 Cleanup in FreeIdSet
-
- Resolved
-