Stopping the execution thread


clinstance->stop();

x::threadmsgdispatcherObj subclasses x::stoppableObj and implements a stop() method which sends a message to the dispatcher thread that throws an exception when it gets invoked. Unless explicitly caught, the exception terminates the subclass's dispatch loop. This provides a convenient mechanism for stopping the dispatcher thread.