@Override
    public void run() {
        
        synchronized(numberOfActiveProducerLocks){
        numberOfRunningProducers++;
        }
   try{
            
        Random rnd= new Random();
        for(int i=0 ; i<totalNumberOfItemsToProduce ; i++){
          //Check if queue is already full
            if(scheduledQueue.isFull()){
             break;
            }else {
                
             int producedItem = rnd.nextInt(50);
             System.out.println("Producer ["+name+"] produced >>> "+producedItem+" number "+i);
             scheduledQueue.addItem(producedItem);
             Thread.sleep(rnd.nextInt(45));
                   }
            }
     }catch(InterruptedException ex){
                System.out.println("Producer "+name+" process was killed");
            }
       synchronized(numberOfActiveProducerLocks){
          numberOfRunningProducers--;
       }     
            
   }