[crac] RFR: Active cleanup by CleanerImpl on checkpoint [v3]

Anton Kozlov akozlov at openjdk.org
Wed Jun 7 16:00:32 UTC 2023

On Wed, 7 Jun 2023 06:14:36 GMT, Radim Vansa <duke at openjdk.org> wrote:

>> src/java.base/share/classes/jdk/internal/ref/CleanerImpl.java line 160:
>>> 158:                             wait();
>>> 159:                         }
>>> 160:                         cleanupComplete = false;
>> AFIAU this synchronizes with beforeCheckpoint to verfiy cleanupComplete==true is noticied. An alternative would be to drop this sync, releasing cleaner sooner, and then just reset cleanupComplete in beforeCheckpoint(). But this is not a big deal.
> This has a point, the waiting is not needed in here. I've moved the synchronization from previous version rather mindlessly.

In the current state, at initialization `forceCleanup == cleanupComplete == false`. But after synchronization has been started, `forceCleanup == !cleanupComplete`, always. It seems possible to drop cleanupComplete, right?


PR Review Comment: https://git.openjdk.org/crac/pull/73#discussion_r1221843728

More information about the crac-dev mailing list