public void perform(Runnable cmd) {
        if (Thread.currentThread() == thread) {
            cmd.run();
            return;
        }
        if (!postCommand(cmd)) {
            join();
            synchronized (thread) {
                cmd.run();
            }
        }
    }
Performs the given command in such a way that it does not run
concurrently with the transport thread or other commands
performed by invoking this method. This method will continue to
work even after the transport thread has been shut down.

@param cmd the command to perform
jrt/src/com/yahoo/jrt/TransportThread.java