protected void initializePending(){ AppState[] array = getInitializing(); if (array.length == 0) return; synchronized( states ) { // Move the states that will be initialized // into the active array. In all but one case the // order doesn't matter but if we do this here then // a state can detach itself in initialize(). If we // did it after then it couldn't. List<AppState> transfer = Arrays.asList(array); states.addAll(transfer); initializing.removeAll(transfer); } for (AppState state : array) { state.initialize(this, app); } }
protected void initializePending(){ AppState[] array = getInitializing(); synchronized( states ) { // Move the states that will be initialized // into the active array. In all but one case the // order doesn't matter but if we do this here then // a state can detach itself in initialize(). If we // did it after then it couldn't. List<AppState> transfer = Arrays.asList(array); states.addAll(transfer); initializing.removeAll(transfer); } for (AppState state : array) { state.initialize(this, app); } }
protected void initializePending(){ AppState[] array = getInitializing(); if (array.length == 0) return; synchronized( states ) { // Move the states that will be initialized // into the active array. In all but one case the // order doesn't matter but if we do this here then // a state can detach itself in initialize(). If we // did it after then it couldn't. List<AppState> transfer = Arrays.asList(array); states.addAll(transfer); initializing.removeAll(transfer); } for (AppState state : array) { state.initialize(this, app); } }