Esempio n. 1
0
  // Copy the ThreadContainer tree structure down into the underlying Threadable objects
  // (Make the Threadable tree look like the ThreadContainer tree)
  void flush() {
    if (parent != null && threadable == null)
      throw new RuntimeException("no threadable in " + this.toString());

    parent = null;

    if (threadable != null) threadable.setChild(child == null ? null : child.threadable);

    if (child != null) {
      child.flush();
      child = null;
    }

    if (threadable != null) threadable.setNext(next == null ? null : next.threadable);

    if (next != null) {
      next.flush();
      next = null;
    }

    threadable = null;
  }