@Override
    public void run() {
      logger.info("BasicLockClient running");
      while (stayinAlive) {
        synchronized (sync) {
          if (requests.size() > 0) {
            Integer requestId = (Integer) requests.removeFirst();
            Integer operationId = (Integer) operationsMap.get(requestId);
            try {
              switch (operationId) {
                case 1:
                  logger.info("BasicLockClient lock");
                  assertThat(DistributedLockService.getServiceNamed(dlsName).lock(key, -1, -1))
                      .isTrue();
                  break;
                case 2:
                  logger.info("BasicLockClient unlock");
                  DistributedLockService.getServiceNamed(dlsName).unlock(key);
                  break;
                case 3:
                  logger.info("BasicLockClient suspendLocking");
                  assertThat(DistributedLockService.getServiceNamed(dlsName).suspendLocking(-1))
                      .isTrue();
                  break;
                case 4:
                  logger.info("BasicLockClient resumeLocking");
                  DistributedLockService.getServiceNamed(dlsName).resumeLocking();
                  break;
                case 5:
                  logger.info("BasicLockClient stopping");
                  stayinAlive = false;
                  break;
              } // switch
            } // try
            catch (VirtualMachineError e) {
              SystemFailure.initiateFailure(e);
              throw e;
            } catch (Throwable t) {
              throwables.put(requestId, t);
            } finally {
              completedRequests.add(requestId);
              sync.notify();
            }
          }
          try {
            sync.wait();
          } catch (InterruptedException e) {
            logger.info("BasicLockClient interrupted");
            stayinAlive = false;
          }
        } // sync
      } // while
    }
Assumes there is only one host, and invokes the given method in the first numVMs VMs that host
knows about.
geode-core/src/distributedTest/java/org/apache/geode/distributed/DistributedLockServiceDUnitTest.java