ThreadPoolExecutor and finalization

Andrej Golovnin andrej.golovnin at
Mon Oct 30 07:02:44 UTC 2017

Hi David,

> On 30. Oct 2017, at 01:40, David Holmes <david.holmes at> wrote:
> Hi Roger,
> On 30/10/2017 10:24 AM, Roger Riggs wrote:
>> Hi,
>> With the deprecation of Object.finalize its time to look at its uses too see if they can be removed or mitigated.
> So the nice thing about finalize was that it followed a nice/clean/simple OO model where a subclass could override, add their own cleanup and then call super.finalize(). With finalize() deprecated, and the new mechanism being Cleaners, how do Cleaners support such usages?

Instead of ThreadPoolExecutor.finalize you can override ThreadPoolExecutor.terminated.

Best regards
Andrej Golovnin

More information about the core-libs-dev mailing list