'Acquire the lock file.
:raises errors.LockError: if lock is already held
:raises OSError: if unable to open or stat the lock file'

def acquire(self):

    while (self._fd is None):
        fd = os.open(self._path, (os.O_CREAT | os.O_WRONLY), 384)
        try:
            self._try_lock(fd)
            if self._lock_success(fd):
                self._fd = fd
        finally:
            if (self._fd is None):
                os.close(fd)
