Re: delete-process bug

From:

Stefan Monnier

Subject:

Re: delete-process bug

Date:

Fri, 26 May 2006 09:10:33 -0400

User-agent:

Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> Thanks for working on this. I agree that `live_deleted_processes'
> is a good name. ("Zombie process" has a different meaning.)
> However, maybe there is still a race condition. Suppose the signal
> comes in the middle of the line
> + live_deleted_processes = Fcons (make_number (p->pid),
> + /* GC previous elements. */
> + Fdelq (Qnil, live_deleted_processes));
> Suppose it comes between there and the call to remove_process?
I think it's OK: if the signal handler comes before the assignment to
live_deleted_processes, then it'll all behave as if the signal came even
before the call to delete-process. If it comes afterwards, the signal will
be ignored (as if it came after the call to delete-process).
> Does the right thing happen in all these cases?
I believe so.
> Also, please remember that in Emacs braces go on lines by themselves:
> + tail = Fmemq (make_number (pid), live_deleted_processes);
> + if (!NILP (tail)) {
> + Fsetcar (tail, Qnil);
> + return;
> + }
I do remember, but indeed I missed this one. Thanks for spotting it.
Stefan