Stops all active threads and rejects new tasks to be added
        Args:
            block (bool): If True, block until all threads are closed

def stop(self, block=True):
        """ Stops all active threads and rejects new tasks to be added
        Args:
            block (bool): If True, block until all threads are closed
        """
        self._stop = True

        # Removing tasks in queue
        self.empty_queue()

        # All active threads
        # With the DoNothing function
        # Because self._stop is True each thread will process at most one of the DoNothing functions
        # Hence it is ensured that all .get calls are triggered
        for _ in range(self.threads_active()):
            self._queue.put(SetPrio(target=DoNothing))

        if block:
            # Blocking until all threads are closed
            self.join()

            # Removing any leftover DoNothing functions (Can only be reliably done when all threads are closed)
            self.empty_queue()