/**
     * Check if flags in correct state.
     *
     * @param msg Message.
     */
    private void checkSyncFlags(GridIoMessage msg) {
      if (!commSpiEnabled) return;

      Object o = msg.message();

      if (!(o instanceof GridDistributedLockRequest)) return;

      GridKernal g = (GridKernal) G.grid(nodeId);

      GridCacheTxManager<Object, Object> tm =
          g.internalCache(REPLICATED_ASYNC_CACHE_NAME).context().tm();

      GridCacheVersion v = ((GridCacheVersionable) o).version();

      GridCacheTxEx t = tm.tx(v);

      if (t.hasWriteKey("x1")) {
        assertFalse(t.syncCommit());
      } else if (t.hasWriteKey("x2")) {
        assertTrue(t.syncCommit());
      } else if (t.hasWriteKey("x3")) {
        assertFalse(t.syncCommit());
      } else if (t.hasWriteKey("x4")) {
        assertTrue(t.syncCommit());
      }
    }