#vulnerable code 
                                public void startMixer() {
        if (!started) {
            started = true;
            output.buffer.clear();
            scheduler.submit(mixer,scheduler.MIXER_MIX_QUEUE);
            mixCount = 0;
            Iterator<Input> activeInputs=inputs.iterator();
            while(activeInputs.hasNext())
            	activeInputs.next().start();            
        }
    } 
                            #location 4 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                                public void startMixer() {
        if (!started) {
            started = true;
            output.resetBuffer();            
            mixCount = 0;
            Iterator<Input> activeInputs=inputs.iterator();
            Input currInput;
            while(activeInputs.hasNext())
            {
            	currInput=activeInputs.next();
            	currInput.resetBuffer();
            	currInput.start();
            }            	     
            scheduler.submit(mixer,scheduler.MIXER_MIX_QUEUE);
        }
    }