'Check if a key is in the dict.
It locks it for writes when doing so.'

def __contains__(self, key):

    self.lock.acquire()
    result = dict.__contains__(self, key)
    self.lock.release()
    return result
