public synchronized void timeout(long millis, Runnable callback) {
		if (isUnblocked()) return;
		Task<Void,NoException> task = new Task.Cpu<Void,NoException>("JoinPoint timeout", Task.PRIORITY_RATHER_LOW) {
			@Override
			public Void run() {
				synchronized (JoinPoint.this) {
					if (isUnblocked()) return null;
					if (callback != null)
						try { callback.run(); }
						catch (Throwable t) {
							LCCore.getApplication().getDefaultLogger().error("Error in callback of JoinPoint timeout", t);
						}
					unblock();
					return null;
				}
			}
		};
		task.executeIn(millis);
		if (isUnblocked()) return;
		task.start();
	}
public synchronized void timeout ( long millis , Runnable callback ) { if ( isUnblocked ( ) ) return ; Task < Void , NoException > task = new Task . Cpu < Void , NoException > ( "JoinPoint timeout" , Task . PRIORITY_RATHER_LOW ) { @ Override public Void run ( ) { synchronized ( JoinPoint . this ) { if ( isUnblocked ( ) ) return null ; if ( callback != null ) try { callback . run ( ) ; } catch ( Throwable t ) { LCCore . getApplication ( ) . getDefaultLogger ( ) . error ( "Error in callback of JoinPoint timeout" , t ) ; } unblock ( ) ; return null ; } } } ; task . executeIn ( millis ) ; if ( isUnblocked ( ) ) return ; task . start ( ) ; }
Should be used only for debugging purpose, as a JoinPoint is supposed to always become unblocked.<br/>
This method will wait for the given milliseconds, if at this time the JoinPoint is already unblocked,
nothing is done, else we force it to become unblocked, and the given callback is called if any.