def finalize(self):
with self._lock:<EOL><INDENT>self._is_finalized = True<EOL>if self._count == <NUM_LIT:0>:<EOL><INDENT>self._callback()<EOL><DEDENT><DEDENT>
Finalize the counter

        Once finalized, the counter never be incremented and the callback
        can be invoked once the count reaches zero