'Loads and pre-caches all relevant locks and their functions.
Args:
obj (object): The object on which the lockhandler is
defined.'

def __init__(self, obj):

    if (not _LOCKFUNCS):
        _cache_lockfuncs()
    self.obj = obj
    self.locks = {}
    try:
        self.reset()
    except LockException as err:
        logger.log_trace(err)
