[crac] RFR: Prevent concurrent cleanup by cleaner thread and checkpoint notifications
Anton Kozlov
akozlov at openjdk.org
Tue May 30 16:24:24 UTC 2023
On Thu, 25 May 2023 06:56:51 GMT, Radim Vansa <duke at openjdk.org> wrote:
>> src/java.base/share/classes/jdk/internal/ref/CleanerImpl.java line 182:
>>
>>> 180: // completed by the cleaner.
>>> 181: blockForCheckpoint = true;
>>> 182: thread.interrupt();
>>
>> Why it has to be interrupt and not notify(), for example?
>
> The interrupt wakes up cleaner in `queue.remove()` (line 161) in case it's blocking for next task.
OK, thanks. But what if the interrupt arrives to the thread during a cleaning while that runs, it may interrupt the cleaning, right?
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/73#discussion_r1210523210
More information about the crac-dev
mailing list