INNER CODE UNIT · Java
tryIsolate
RuedigerMoeller/kontraktor · attic/ElasticScheduler.java:410
public void tryIsolate(DispatcherThread dispatcherThread, Actor refToExclude /*implicitely indicates unblock*/) {
if ( dispatcherThread != Thread.currentThread() )
throw new RuntimeException("bad error");
synchronized (balanceLock) {
// move to actor with minimal load
if ( refToExclude == null ) {
throw new IllegalArgumentException("excluderef should not be null");
}
Actor qList[] = dispatcherThread.getActors();
DispatcherThread minLoadThread = findMinLoadThread(Integer.MAX_VALUE, dispatcherThread);
for (int i = 0; i < threads.length; i++) { // avoid further dispatch
if ( threads[i] == dispatcherThread ) {
threads[i] = createDispatcherThread();
dispatcherThread.setName(dispatcherThread.getName()+" (isolated)");
dispatcherThread.setIsolated(true);
isolateCount.incrementAndGet();
minLoadThread = threads[i];
minLoadThread.start();