Subject: Re: bug#41242: Port feature/native-comp to Windows

From: Eli Zaretskii <[email-masked]>
Date: Thu, 14 May 2020 22:13:31 +0300

> From: Nicolas Bértolo <[email-masked]>
> Date: Thu, 14 May 2020 15:40:28 -0300
> Cc: Eli Zaretskii <[email-masked]>, [email-masked]
> 
> * Emacs1 renames foo.eln to foo.eln.old. It tries to delete it but fails since
>   Emacs2 has an open handle.
> 
> * Emacs2 finally calls FreeLibrary() and closes.
> 
> In this case we are left over with a stale foo.eln.old. I don't think we can
> have a race free algorithm.

When Emacs1 fails to delete foo.eln.old, it could record the file's
deletion to be attempted again when it exits.  That won't solve all
the cases, but it will solve some of them.