Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Interrupting globs (Re: Something rotten in tar completion)



On Sun, 07 Dec 2014 18:37:33 +0100
Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> Peter wrote:
> > 
> > It's also just occurred to me I may have introduced some rare but
> > entirely possible read-modify-write races because we set the ERRFLAG_INT
> > bit in interrupts and set the other and clear both bits separately in
> > the main shell.  I guess it would be better to queue interrupts whenever
> > we add or remove a single bit of errflag; that's probably not often
> > enough to cause efficiency issues since should only be round significant
> > chunks of shell code, or when an error has actually occurred.  Opinions?
> 
> Could that perhaps be solved by making errflag a volatile sig_atomic_t
> instead of an int?

It should probably at least be volatile anyway, given it's set in
interrupts regardless of the interrupt_abort changes.

It's not clear to me this is good enough to fix read/modify/write races;
as far as I can see the intention is this makes reads and writes
separately atomic.  However, I'm not an expert on this so I may be
wrong.

pws



Messages sorted by: Reverse Date, Date, Thread, Author