if(bnSubject != null) {
bnSubject.sendChat("Updated to " + vnLatest.toString() + "; restarting", whisperBack);
// Wait a maximum of 10 seconds for the queue to empty
long target = System.currentTimeMillis() + 10000;
ChatQueue cq = bnSubject.getConnection().getProfile().getChatQueue();
while((cq.size() > 0) && (target > System.currentTimeMillis())) {
Thread.sleep(100);
Thread.yield();
}
}