code: def lock_host(func, *args, **kwargs):
      
      def inner(self, *args, **kwargs):
          self.host_lock.acquire()
          try:
              res = func(self, *args, **kwargs)
              self.host_lock.release()
          except Exception as e:
              self.host_lock.release()
              raise e
          return res
      return inner
docs: A decorator that acquires a lock before accessing the debugger to
      avoid API locking related errors with the debugger host.