'Run the method in sub-thread after acquiring the stack lock.
Release the lock when the thread finishes.
:param cnxt: RPC context
:param stack: Stack to be operated on
:type stack: heat.engine.parser.Stack
:param engine_id: The UUID of the engine/worker acquiring the lock
:param func: Callable to be invoked in sub-thread
:type func: function or instancemethod
:param args: Args to be passed to func
:param kwargs: Keyword-args to be passed to func.'

def start_with_lock(self, cnxt, stack, engine_id, func, *args, **kwargs):

    lock = stack_lock.StackLock(cnxt, stack.id, engine_id)
    with lock.thread_lock():
        th = self.start_with_acquired_lock(stack, lock, func, *args, **kwargs)
        return th
