public boolean destroy() {
        boolean done = false;
        enqueue(TERMINATE);
        if (!destroyed.getAndSet(true)) {
            try {
                synchronized (this) {
                    while (!queue.isEmpty()) {
                        wait();
                    }
                }
                thread.join();
            } catch (InterruptedException e) {
                // ignore
            }
            done = true;
        }
        return done;
    }
<p>Sets the destroyed flag to true. The very first time this method is
called, it cleans up all its dependencies.  Even if you retain a
reference to this object, all of its content is allowed to be garbage
collected.</p>

@return True if content existed and was destroyed.
messagebus/src/main/java/com/yahoo/messagebus/Messenger.java