zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <Peter.Stephenson@csr.com>
To: zsh-workers@zsh.org
Subject: Re: Bug#593426: zsh: Status of background jobs not updated
Date: Fri, 20 Aug 2010 09:55:27 +0100	[thread overview]
Message-ID: <20100820095527.4ef353e1@csr.com> (raw)
In-Reply-To: <100819212253.ZM27882@torch.brasslantern.com>

On Thu, 19 Aug 2010 21:22:51 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Aug 18,  9:09pm, Peter Stephenson wrote:
> }
> } +	    } else if (sig == SIGCONT) {
> } +		Job jn;
> } +		Process pn;
> } +		if (findproc(pid, &jn, &pn, 0)) {
> } +		    if (WIFSTOPPED(pn->status))
> } +			pn->status = SP_RUNNING;
> } +		}
> } +	    }
> 
> Hmm, are we really guaranteed that the job has started running again
> just because we killed it with SIGCONT?  E.g., if the reason it was
> stopped is because it got a TTIN or TTOU, is there a possible race
> here because it's just going to immediately stop again?

Well, signals are queued at this point, so if there's another stop signal
it should be handled after marking the process as continued.

But it would still be better to check the status by waiting at appropriate
points, which needs the fix to take care of the case that the child has
actually exited I mentioned before, which needs a lot of care as it's
dealing with some basic and race-prone stuff.

-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom


  reply	other threads:[~2010-08-20  8:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20100818025148.13456.14691.reportbug@salamander.skynet.lan>
2010-08-18 18:29 ` Clint Adams
2010-08-18 20:09   ` Peter Stephenson
2010-08-20  4:22     ` Bart Schaefer
2010-08-20  8:55       ` Peter Stephenson [this message]
2010-08-21  0:07         ` Peter Stephenson
2010-08-19 22:14 Jilles Tjoelker
2010-08-20  2:36 ` Bart Schaefer
2010-08-20 20:21   ` Jilles Tjoelker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100820095527.4ef353e1@csr.com \
    --to=peter.stephenson@csr.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).