code: def clear(self):
          
          with self.__lock:
              # Empty the current queue
              try:
                  while True:
                      self._queue.get_nowait()
                      self._queue.task_done()
              except queue.Empty:
                  # Queue is now empty
                  pass
  
              # Wait for the tasks currently executed
              self.join()
docs: Empties the current queue content.
          Returns once the queue have been emptied.