'Starts a critical section in which the number of workers is limited.
Starts a critical section which allows self.__enabled_count
simultaneously operating threads. The critical section is ended by
calling self.FinishWork().'

def StartWork(self):

    self.__thread_semaphore.acquire()
    if (self.__backoff_time > 0.0):
        if (not threading.currentThread().exit_flag):
            logger.info('[%s]    Backing    off    due    to    errors:    %.1f    seconds', threading.currentThread().getName(), self.__backoff_time)
            self.__sleep(self.__backoff_time)
