[MERGE] Cleanup and test Lock objects
Bubba
flintcherokee at gmail.com
Thu Mar 15 19:18:15 GMT 2007
Hi everyone,
Can I take the tools plugins like it is and run selftest. How is it
are yall working for 0.16.0
Plugins.
Bubba
On 3/15/07, Alexander Belchenko <bialix at ukr.net> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> John Arbash Meinel пишет:
> > Alexander Belchenko wrote:
> >> John Arbash Meinel ?8H5B:
> >
> >>>> + class _ctypes_FileLock(_base_Lock):
> >>>> +
> >>>> + def _lock(self, filename, openmode, lockmode):
> >>>> + self._open(filename, openmode)
> >>>> +
> >>>> + self.hfile = msvcrt.get_osfhandle(self.f.fileno())
> >>>> + overlapped = OVERLAPPED()
> >>>> + p_overlapped = ctypes.pointer(overlapped)
> >> ^-- In my own programs I use ctypes.byref() function to pass pointer to
> some
> >> struct in C-function as argument. I'm okay with your implementation
> though.
> >
> > Either way. I was looking for a way to get a pointer, and this is what I
> > found in cytypes.
> >
> > Your idea is
> >
> > result = _LockFileEx(self.hfile,
> > lockmode,
> > 0,
> > 0x7fffffff,
> > 0x00000000,
> > overlapped.byref(),
> > )
> >
> > Is that correct?
>
> No, ctypes-object does not have .byref method.
> It should be actually: ctypes.byref(overlapped).
>
> > I actually submitted this, because I thought you approved from my add-on
> > patch.
>
> Sorry for this. I vote on your second patch earlier and want to study big
> one as well,
> but don't have the time to carefully read your big patch during this day.
> I hope I help (a little).
>
> > But I'm happy to do your cleanups and submit them.
> >
> > By the way, Alexander, my branch at:
> >
> > http://bzr.arbash-meinel.com/branches/bzr/0.15-dev/locking
> >
> > now has proper support for updating the dirstate during 'bzr status'.
>
> Great, thanks.
>
> >
> > It also has updated fcntl locks, so it exposes the same bugs in our
> > code. (Places where we are opening the same tree 2 times, and expecting
> > to be able to take a read and write lock at the same time).
> >
> > You may want to give it a look.
>
> Definitely.
>
> [µ]
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFF+ZdmzYr338mxwCURArCgAJ9wWrFpmDe3CQJlVUPdKa6FFiFMWgCfePHN
> 1CuEFxk7aTfwg8a5HQR0Ri4=
> =q8hD
> -----END PGP SIGNATURE-----
>
>
--
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
iD8DBQFFkcN7yXWcajQQndYRAgbqAKCMyXN9Jx4g0X7jocg+aUSFz0x4LwCgrURW
eGtqLjpzQVYa9+gzpCRtB84=
=zrpM
-----END PGP SIGNATURE-----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/bazaar/attachments/20070315/7911422c/attachment.htm
More information about the bazaar
mailing list