Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Can periodic hook stop rescheduling?
- X-seq: zsh-users 21890
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- Subject: Re: Can periodic hook stop rescheduling?
- Date: Tue, 13 Sep 2016 15:34:02 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=I7pm/+LCmjx5B1SJrmeByB/84jXokBGoDYumLc+DX+E=; b=VdUKgEM5cgaXDPGPz7m3dNhaIbwHUz/ta5wzqLm8wTGuB9S+7HUaPGTjHAxWnCJkEB kEZNaP3znPv+ENqWqnteG3qjKH3CYOf4ce/2oxeuCZEafW8lyWDVNY9DXvrU1AySFFtU ZQbV9dEfMdp8cBlQsZsShDAbJ+ezAcDtS+GM5/XegVBaSNJTD+Nrsr9ytAoup11zE5i1 k5q5UG6Npq8a+UCQAQ8XR0l7AjvLNpxwN4b/Imelu35bMu2SRAuuQ5kaBDFW5I2TD5JR wv2GCiOkUBig5leo8X72i8jCXmiU4V/9wk5IrnZDH+1qq+J9iy8UpfygI/jDv/q8shXq YSxw==
- In-reply-to: <20160913142003.480cfd9c@pwslap01u.europe.root.pri>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CGME20160913085130eucas1p19723ac09c11d596542360173e4a4b308@eucas1p1.samsung.com> <CAKc7PVDkrKD_2VyvO_2JigwfvU1m=3QwO4Vac=HgHZNbOOU7pA@mail.gmail.com> <20160913142003.480cfd9c@pwslap01u.europe.root.pri>
On 13 September 2016 at 15:20, Peter Stephenson
<p.stephenson@xxxxxxxxxxx> wrote:
> On Tue, 13 Sep 2016 10:49:35 +0200
> The function that's being called is certainly not immune from getting
> ^C, and that can certainly stop "sched +2" in its tracks just like any
> other command. The only general fix for this would be blocking SIGINT
> sufficiently early that ^C doesn't hit this and restoring it later ---
> but given sched +2 is the first line of the script anyway that doesn't
> look promising.
Blocking INT is the second thing done in the function:
setopt localtraps; trap '' INT
I thought: sched will run faster than "setopt localtraps..." and this
way give better guarantee that rescheduling will not be stopped. So I
chosen to sched first, then block trap, but can reverse that, no
problem.
> You might have better results with
>
> {
> ...
> } always {
> sched +2 ...
> }
>
> but it's still subject to the same problem if the ^C happens at the
> wrong point.
>
> This may need some lateral thinking.
"always" looked promising, too bad it's still subject to Ctrl-C
Best regards,
Sebastian Gniazdowski
Messages sorted by:
Reverse Date,
Date,
Thread,
Author