Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77039 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95516 invoked from network); 2 Sep 2014 14:39:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Sep 2014 14:39:27 -0000 Authentication-Results: pb1.pair.com header.from=guilhermeblanco@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=guilhermeblanco@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.171 as permitted sender) X-PHP-List-Original-Sender: guilhermeblanco@gmail.com X-Host-Fingerprint: 209.85.213.171 mail-ig0-f171.google.com Received: from [209.85.213.171] ([209.85.213.171:42161] helo=mail-ig0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FE/E1-18348-E96D5045 for ; Tue, 02 Sep 2014 10:39:26 -0400 Received: by mail-ig0-f171.google.com with SMTP id l13so14293619iga.4 for ; Tue, 02 Sep 2014 07:39:23 -0700 (PDT) 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:content-type; bh=01yHH8KxyhfMa4zX0aVUYJbCcXWERFUKUXNNXy0NfHM=; b=ZN+r4qX5qKr+M61xS+tMRCKt3arvUcD5EtnfyIPIKR6mHViK+CNllAL7USKKm6fwzX /vphH5D9Vmq/ihJCqCdHQLxM2I8MW/A+gZtTnskYBHdvGfzQ0pT55FOTUzr4lxmxLIr4 pfoC+IP/H6wPoQdrEHaq81F0omRGFcbA5uPcG7xivWV0hUFc0eVLvpNcG0fuAJ773nwW 2GRnF1P9Brm9UGed4nR8aL+yOvn9rUQHhQcKnKsOfcZC73cZ1tn63iUr47WFz8w5o+Mi OBbD3iIdM54vcCC9RGPsaSy4Q7zQZRPKSjnL2XFfDhXUnSfUMyOMdH1e1VDQAmB5loCR 4j4Q== X-Received: by 10.42.212.146 with SMTP id gs18mr1105165icb.96.1409668763016; Tue, 02 Sep 2014 07:39:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.8.24 with HTTP; Tue, 2 Sep 2014 07:39:02 -0700 (PDT) In-Reply-To: <5405CDA0.8010401@beccati.com> References: <5405BD15.2070602@beccati.com> <5405CDA0.8010401@beccati.com> Date: Tue, 2 Sep 2014 10:39:02 -0400 Message-ID: To: Matteo Beccati Cc: PHP internals Content-Type: multipart/alternative; boundary=485b397dd05fdee3360502161562 Subject: Re: [PHP-DEV] Optional nowait argument to sem_acquire From: guilhermeblanco@gmail.com ("guilhermeblanco@gmail.com") --485b397dd05fdee3360502161562 Content-Type: text/plain; charset=UTF-8 Hi Matteo, BSD does accept it as sem_timedwait, which I could find a reference for FreeBSD: http://www.freebsd.org/cgi/man.cgi?query=sema&sektion=9 Cheers, On Tue, Sep 2, 2014 at 10:01 AM, Matteo Beccati wrote: > Hi, > > On 02/09/2014 15:38, guilhermeblanco@gmail.com wrote: > > I'd propose instead of accepting "nowait" only, I'd use a better support > > and accept "until", dealing with possible cases: > > > > * -1: Blocks and wait until lock is acquired > > * 0: Exactly what your patch does, attempt to grab and if it fails, > > just return false (I'd remove the E_WARNING) > > (It doesn't. The warning is raised when the semaphore can't be acquired > for other reasons) > > > * > 0: Acceptable time in milliseconds it would wait until consider > > the acquire failed > > TBH, I don't know. semtimedop is not universally available (no BSD, as > far as I can tell) and I would prefer to avoid writing an alternative > implementation in case it's not available. On the other hand triggering > an error in such case wouldn't be nice. > > > Cheers > -- > Matteo Beccati > > Development & Consulting - http://www.beccati.com/ > -- Guilherme Blanco MSN: guilhermeblanco@hotmail.com GTalk: guilhermeblanco Toronto - ON/Canada --485b397dd05fdee3360502161562--