All pastes #2076006 Raw Edit

Someone

public text v1 · immutable
#2076006 ·published 2011-06-07 06:49 UTC
rendered paste body
		final int serverTimeout = getStopTimeout() * 1000;
		if (serverTimeout > 0) {
			Thread thread = new Thread("Server Stop Timeout") {
				public void run() {
					try {
						Thread.sleep(serverTimeout);
						if (!timer.alreadyDone) {
							timer.timeout = true;
							// notify waiter
							synchronized (mutex) {
								if (Trace.FINEST) {
									Trace.trace(Trace.STRING_FINEST, "stop notify timeout");
								}
								mutex.notifyAll();
							}
						}
					} catch (Exception e) {
						if (Trace.SEVERE) {
							Trace.trace(Trace.STRING_SEVERE, "Error notifying server stop timeout", e);
						}
					}
				}
			};
			thread.setDaemon(true);
			thread.start();