From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 692 invoked by alias); 13 Sep 2016 13:39:54 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21890 Received: (qmail 3284 invoked from network); 13 Sep 2016 13:39:54 -0000 X-Qmail-Scanner-Diagnostics: from mail-qt0-f180.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.216.180):SA:0(0.0/5.0):. Processed in 0.315424 secs); 13 Sep 2016 13:39:54 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,SPF_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: sgniazdowski@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.216.180 as permitted sender) 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=I7pm/+LCmjx5B1SJrmeByB/84jXokBGoDYumLc+DX+E=; b=MtJ9iPFKRK3NDGkKDC2DnwJPX60xVA4II7ZKhl30dFU1MlzMDEj/oZ92OOMxVmJBWq zwWtrjdKHYEbXbpcgwxIfwV32nZl4/TE4oExw7xwoqrhM9VagBG5UJS+pmIXRmeUdzdI GMjoNySRKApuh1Dem3D/Zx2IEJzuizBdE97bDN+b3cyWk/QXVC5X3nAQ3N2yWNqc4Bhg xt82fbNEsq9gAnFjmJ98ilyZrnIu2PXq/J0uGWu1rEK+31K7LmbjGBLl4n1eBc7UwnSf 9lKp1tlrIfD//FM96vWteeLJVH05imq3Z9GATgbetgDXSKrJ+iLXlKf8/kutkUinXIjl 3YUA== X-Gm-Message-State: AE9vXwNcpZuwXdSXSlsg6MB6NbggjV7S769qKWcDCffD9Hu7bmEMdpkU4oHWWQjbw0pLp0gFHnmDWbbhU951lg== X-Received: by 10.237.56.170 with SMTP id k39mr968109qte.138.1473773662560; Tue, 13 Sep 2016 06:34:22 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20160913142003.480cfd9c@pwslap01u.europe.root.pri> References: <20160913142003.480cfd9c@pwslap01u.europe.root.pri> From: Sebastian Gniazdowski Date: Tue, 13 Sep 2016 15:34:02 +0200 Message-ID: Subject: Re: Can periodic hook stop rescheduling? To: Peter Stephenson Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 On 13 September 2016 at 15:20, Peter Stephenson 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