private void CommandQueueProcessor(object obj)
{
SetThreadName();
var queue = (CommandQueue) obj;
_log.Info("Command processor thread started.");
while(WaitHandle.WaitAny(new [] {_exitEvent}, 1, true) == WaitHandle.WaitTimeout)
{
IChatMessage command = queue.Next();
ProcessCommands(command);
}
_log.Info("Command processor thread finished.");
}