Acquires the lock if in the unlocked state otherwise switch
        back to the parent coroutine.

def acquire(self, timeout=None):
        """Acquires the lock if in the unlocked state otherwise switch
        back to the parent coroutine.
        """
        green = getcurrent()
        parent = green.parent
        if parent is None:
            raise MustBeInChildGreenlet('GreenLock.acquire in main greenlet')

        if self._local.locked:
            future = create_future(self._loop)
            self._queue.append(future)
            parent.switch(future)

        self._local.locked = green
        return self.locked()