Problem getting flock with timeout to work

Robert Klemme shortcutter@googlemail.com
Thu Mar 12 14:40:00 GMT 2009


Hi,

I searched the archives but could not find any related issue.  My
problem is this: I use flock with a timeout but apparently the timeout
does not work, i.e. flock waits longer than specified.  Script is
attached.  Output is here:

This is ok, timeout is longer than needed:

15:34:27 tmp$ ./fl-test-2.sh
CYGWIN_NT-5.1 padrklemme1 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin
-rw-r--r-- 1 RKlemme Domain Users 0 Mar 12 15:34 lock
timeout 10
started 1
3672 Thu Mar 12 15:34:32 WEST 2009
started 2
3672 Thu Mar 12 15:34:33 WEST 2009
waiting...
3672 Thu Mar 12 15:34:34 WEST 2009
3672 Thu Mar 12 15:34:35 WEST 2009
3672 Thu Mar 12 15:34:36 WEST 2009
2884 Thu Mar 12 15:34:37 WEST 2009
2884 Thu Mar 12 15:34:39 WEST 2009
2884 Thu Mar 12 15:34:40 WEST 2009
2884 Thu Mar 12 15:34:41 WEST 2009
2884 Thu Mar 12 15:34:42 WEST 2009
done

This looks wrong, timeout is much shorter than what the process takes
and should abort:

15:34:43 tmp$ ./fl-test-2.sh 2
CYGWIN_NT-5.1 padrklemme1 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin
-rw-r--r-- 1 RKlemme Domain Users 0 Mar 12 15:34 lock
timeout 2
started 1
2444 Thu Mar 12 15:34:45 WEST 2009
started 2
2444 Thu Mar 12 15:34:47 WEST 2009
waiting...
2444 Thu Mar 12 15:34:48 WEST 2009
2444 Thu Mar 12 15:34:49 WEST 2009
2444 Thu Mar 12 15:34:50 WEST 2009
4064 Thu Mar 12 15:34:51 WEST 2009
4064 Thu Mar 12 15:34:52 WEST 2009
4064 Thu Mar 12 15:34:53 WEST 2009
4064 Thu Mar 12 15:34:55 WEST 2009
4064 Thu Mar 12 15:34:56 WEST 2009
done
15:34:57 tmp$

Any ideas?  Am I doing something wrong?

Kind regards

robert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fl-test-2.sh
Type: application/x-sh
Size: 330 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20090312/1d8da6a2/attachment.sh>
-------------- next part --------------
--
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/


More information about the Cygwin mailing list