public final void unblockSuccess(T result) {
		ArrayList<AsyncWorkListener<T,TError>> listeners;
		synchronized (this) {
			if (unblocked) return;
			unblocked = true;
			this.result = result;
			if (listenersInline == null) {
				this.notifyAll();
				return;
			}
			listeners = listenersInline;
			listenersInline = new ArrayList<>(2);
		}
		Logger log = LCCore.getApplication().getLoggerFactory().getLogger(SynchronizationPoint.class);
		while (true) {
			if (!log.debug())
				for (int i = 0; i < listeners.size(); ++i)
					try { listeners.get(i).ready(result); }
					catch (Throwable t) { log.error(
						"Exception thrown by an inline listener of AsyncWork: " + listeners.get(i), t); }
			else
				for (int i = 0; i < listeners.size(); ++i) {
					long start = System.nanoTime();
					try { listeners.get(i).ready(result); }
					catch (Throwable t) { log.error(
						"Exception thrown by an inline listener of AsyncWork: " + listeners.get(i), t); }
					long time = System.nanoTime() - start;
					if (time > 1000000) // more than 1ms
						log.debug("Listener ready took " + (time / 1000000.0d) + "ms: " + listeners.get(i));
				}
			synchronized (this) {
				if (listenersInline.isEmpty()) {
					listenersInline = null;
					listeners = null;
					this.notifyAll();
					break;
				}
				listeners.clear();
				ArrayList<AsyncWorkListener<T,TError>> tmp = listeners;
				listeners = listenersInline;
				listenersInline = tmp;
			}
		}
	}
public final void unblockSuccess ( T result ) { ArrayList < AsyncWorkListener < T , TError > > listeners ; synchronized ( this ) { if ( unblocked ) return ; unblocked = true ; this . result = result ; if ( listenersInline == null ) { this . notifyAll ( ) ; return ; } listeners = listenersInline ; listenersInline = new ArrayList < > ( 2 ) ; } Logger log = LCCore . getApplication ( ) . getLoggerFactory ( ) . getLogger ( SynchronizationPoint . class ) ; while ( true ) { if ( ! log . debug ( ) ) for ( int i = 0 ; i < listeners . size ( ) ; ++ i ) try { listeners . get ( i ) . ready ( result ) ; } catch ( Throwable t ) { log . error ( "Exception thrown by an inline listener of AsyncWork: " + listeners . get ( i ) , t ) ; } else for ( int i = 0 ; i < listeners . size ( ) ; ++ i ) { long start = System . nanoTime ( ) ; try { listeners . get ( i ) . ready ( result ) ; } catch ( Throwable t ) { log . error ( "Exception thrown by an inline listener of AsyncWork: " + listeners . get ( i ) , t ) ; } long time = System . nanoTime ( ) - start ; if ( time > 1000000 ) log . debug ( "Listener ready took " + ( time / 1000000.0d ) + "ms: " + listeners . get ( i ) ) ; } synchronized ( this ) { if ( listenersInline . isEmpty ( ) ) { listenersInline = null ; listeners = null ; this . notifyAll ( ) ; break ; } listeners . clear ( ) ; ArrayList < AsyncWorkListener < T , TError > > tmp = listeners ; listeners = listenersInline ; listenersInline = tmp ; } } }
Unblock this AsyncWork with the given result.