public void run() {
            try {
                runnable.run();
            } finally {
                threads.remove(thread);
            }
        }
    }
    
	private class SessionThreadImpl extends Thread implements MutableSessionThread {
		private SessionContext state;
		private ChannelSession session;
		
		public SessionThreadImpl(Runnable r) {
			super(r);
		}

		public void setSessionState(SessionContext s) {
			state = s;
		}

		public SessionContext getSessionState() {
			return state;
		}

		public ChannelSession getSession() {
			return session;
		}

		public void setSession(ChannelSession s) {
			session = s;
		}
	}

    public boolean containsThread(Thread t) {
        return threads.contains(t);
    }