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

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



On Sun, 7 Dec 2014 11:58:28 -0800
art Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Dec 7,  6:59pm, Peter Stephenson wrote:
> }
> } I'm worried about the various occurrences of this:
> } 
> } 	    /* Keep any user interrupt error status */
> } 	    errflag = oef | (errflag & ERRFLAG_INT);
> 
> I believe that could be rewritten as
> 
> 	errflag &= ~ERRFLAG_ERROR;
> 	errflag |= oef;
> 
> to avoid reading errflag and then writing back to it.  That's likely
> more efficient than queueing/unqueing signals.

That's better but I think you can still get an ERRFLAG_INT missed
between reading errflag, "and"ing it with ~ERRFLAG_ERROR, and writing it
back again.  It depends on the instruction set whether that's atomic but
there's no guarantee either there or in C.

pws



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