def METHOD_NAME(self, context):
    try:
        self.pendingcalls_submit(context.l, context.n)
    finally:
        with context.lock:
            context.nFinished += 1
            nFinished = context.nFinished
            if False and support.verbose:
                print "finished threads: ", nFinished
        if nFinished == context.nThreads:
            context.event.set()