This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem getting flock with timeout to work


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]