'If the lock is released while an attempt is made to acquire
it, the lock attempt fails and C{FilesystemLock.lock} returns
C{False}.  This can happen on Windows when L{lockfile.symlink}
fails with L{IOError} of C{EIO} because another process is in
the middle of a call to L{os.rmdir} (implemented in terms of
RemoveDirectory) which is not atomic.'

def test_lockReleasedDuringAcquireSymlink(self):

    def fakeSymlink(src, dst):
        raise OSError(errno.EIO, None)
    self.patch(lockfile, 'symlink', fakeSymlink)
    lockf = self.mktemp()
    lock = lockfile.FilesystemLock(lockf)
    self.assertFalse(lock.lock())
    self.assertFalse(lock.locked)
