def getNextTask(self):

        """ Retrieve the next task from the task queue.  For use
        only by ThreadPoolThread objects contained in the pool."""
        
        self.__taskLock.acquire()
        try:
            if self.__tasks == []:
                return (None, None, None)
            else:
                return self.__tasks.pop(0)
        finally:
            self.__taskLock.release()
 Retrieve the next task from the task queue.  For use
        only by ThreadPoolThread objects contained in the pool.
recipes/Python/203871_generic_programming_thread/recipe-203871.py