'Set the state inside of the lock - there are multiple threads who set state here'

def setHostState(self, hostKey, stateType, state):

    if (state is None):
        return
    try:
        self.hostStateLock.acquire()
        self._setHostStateValue(hostKey, stateType, state)
    finally:
        self.hostStateLock.release()
