C++ FizzBuzz multi thread consumer producer : I have the FizzBuzz question with couple of threads (producer and consumer)
I found this solution online : https://gist.github.com/masudak/5098917
But i am worried with a specific case,of a bad context switch ,  where 'isStop'
 is true but not all producers finished adding their numbers to queue.
Is it a real issue? or am i msissing something?

    public static AtomicInteger counter = new AtomicInteger(0);
    public static ConcurrentLinkedQueue<Integer> queue = new ConcurrentLinkedQueue<Integer>();
    public static volatile boolean isStop = false; 
	
    public static class Producer implements Runnable{

        @Override
        public void run() {
	    while ( true ) {
	        Integer counterValue = counter.incrementAndGet();
		if (counterValue <= 100) {
		    queue.add(counterValue);
		} else {
		    isStop = true;
		    break;
		}
	    }
        }	
    }
	
    public static class Consumer implements Runnable{

        @Override
        public void run() {
            while ( true ) {
                Integer counterValue = queue.poll();
	        if ( counterValue == null ){
                    if(isStop){
                        break;
	            }

                    continue;
                }

                fizzBuzz(counterValue);
            }
        }
		
	
        private void fizzBuzz(Integer value){
            if( value % 15 == 0 ){
                System.out.println("FizzBuzz:" + value);
            } else if( value % 3 == 0 ){
                System.out.println("Fizz:" + value);
            } else if( value % 5 == 0 ){				
                System.out.println("Buzz:" + value );
            }else {
                System.out.println(value);
	    }
        }	
    }
	
}