code: def allocate(self):
          
          self.lock.acquire()
          try:
              id_ = self.next_id
              self.next_id += 1
              return id_
          finally:
              self.lock.release()
docs: Arrange for a unique context ID to be allocated and associated with a
          route leading to the active context. In masters, the ID is generated
          directly, in children it is forwarded to the master via a
          :data:`mitogen.core.ALLOCATE_ID` message.