X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 	tests=BAYES_00,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <20090312155236.GX9322@calimero.vinschen.de>
References: <9e3fd2c80903120740u5fa06d62t372cd67212fad1e@mail.gmail.com> 	 <20090312155236.GX9322@calimero.vinschen.de>
Date: Thu, 12 Mar 2009 17:47:32 +0100
Message-ID: <9e3fd2c80903120947i438d8990l8e377f3c22daf6bf@mail.gmail.com>
Subject: Re: Problem getting flock with timeout to work
From: Robert Klemme <shortcutter@googlemail.com>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

2009/3/12 Corinna Vinschen <corinna-cygwin@cygwin.com>:

> On second thought, maybe I don't understand what you're expecting.
> Running the testcase on a Linux box I get this:
>
> Linux calimero 2.6.[etc]
> -rw-r--r-- 1 corinna vinschen 0 Mar 12 16:48 lock
> timeout 10
> started 1
> 3644 Thu Mar 12 16:48:48 CET 2009
> started 2
> 3644 Thu Mar 12 16:48:49 CET 2009
> waiting...
> 3644 Thu Mar 12 16:48:50 CET 2009
> 3644 Thu Mar 12 16:48:51 CET 2009
> 3644 Thu Mar 12 16:48:52 CET 2009
> 3662 Thu Mar 12 16:48:53 CET 2009
> 3662 Thu Mar 12 16:48:54 CET 2009
> 3662 Thu Mar 12 16:48:55 CET 2009
> 3662 Thu Mar 12 16:48:56 CET 2009
> 3662 Thu Mar 12 16:48:57 CET 2009
> done
>
> 9 seconds
>
> I don't see that this is different in the sense of "more correct" than
> on Cygwin.

Sorry, I overlooked the timeout setting: of course, this is correct.
But if you start it with command line argument 1 (i.e. timeout 1
second) the second flock should bail out with an error since it cannot
obtain the lock in time.

Kind regards

robert

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

