emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master 5b5f441: read_key_sequence: correct the handlin


From: Stefan Monnier
Subject: Re: [Emacs-diffs] master 5b5f441: read_key_sequence: correct the handling of raw_keybuf in recursive calls
Date: Thu, 23 Nov 2017 13:46:44 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>> Hmm... that might work, but I still can't imagine what comment I could
>> write next to the code to explain/prove that it's safe.
> It's as safe as the original, since the only buffer space used is the
> original raw_keybuf, indexed by raw_keybuf_count.  The only change is to
> initialise raw_keybuf_count in different places, to allow the recursive
> call to read_key_sequence not to overwrite the current buffer contents.

I had misunderstood.  Yes, that does look safe.  No idea if it's correct
enough in practice, but it looks much better than what we have.
Thanks.

>> Yet, with the new concurrency feature, the unwind might reset the
>> global var to a pointer into a stack area on another thread, which may
>> have gotten stale in the mean time.
> If we've got two tasks simultaneously accessing that global buffer,
> we're in deep trouble anyway.  Obviously some sort of lock would need to
> be applied to this and other global things.

I think in this case eliminating this-single-command-raw-keys is
a better solution, since we can then eliminate the global var.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]