It looks like the CRT implements this by calling the LockFile/UnlockFile Win32 
APIs (potentially retrying w/ 1 second between tries depending on the mode) so 
we could do that ourselves w/ the OS file handles.

-----Original Message-----
From: Jeff Hardy [mailto:jdha...@gmail.com] 
Sent: Friday, March 25, 2011 11:08 AM
To: Discussion of IronPython
Cc: Dino Viehland
Subject: Re: [IronPython] IronPython2.7 import locking error

On Thu, Mar 24, 2011 at 6:41 PM, Dino Viehland <di...@microsoft.com> wrote:
> Oh I see I missed the line containing msvcrt.  This just looks like it hasn't 
> been implemented (we still have only a very partially implemented version of 
> msvcrt).  It should be trivial to do add this , it should just be a P/Invoke 
> out to msvcrt100, if someone wants to provide a patch.

It seems to me that msvcrt.locking is actually quite tricky, as it normally 
uses the CRT file handles when calling the locking functions.
We'd have to emulate the behavior using the .NET locking functions (or rewrite 
all of our file APIs to use the CRT).

- Jeff

_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to