def task_done(self):
self.all_tasks_done.acquire()<EOL>try:<EOL><INDENT>unfinished = self.unfinished_tasks - <NUM_LIT:1><EOL>if unfinished <= <NUM_LIT:0>:<EOL><INDENT>if unfinished < <NUM_LIT:0>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>self.all_tasks_done.notify_all()<EOL><DEDENT>self.unfinished_tasks = unfinished<EOL><DEDENT>finally:<EOL><INDENT>self.all_tasks_done.release()<EOL><DEDENT>
Indicate that a formerly enqueued task is complete.

        Used by Queue consumer threads.  For each get() used to fetch a task,
        a subsequent call to task_done() tells the queue that the processing
        on the task is complete.

        If a join() is currently blocking, it will resume when all items
        have been processed (meaning that a task_done() call was received
        for every item that had been put() into the queue).

        Raises a ValueError if called more times than there were items
        placed in the queue.