<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def atlas_peer_table_lock():
 """ Lock the global health info table. Return the table. """

    global PEER_TABLE_LOCK, PEER_TABLE, PEER_TABLE_LOCK_HOLDER, PEER_TABLE_LOCK_TRACEBACK

    if PEER_TABLE_LOCK_HOLDER is not None:
        assert PEER_TABLE_LOCK_HOLDER != threading.current_thread(), "DEADLOCK"
        # log.warning("\n\nPossible contention: lock from %s (but held by %s at)\n%s\n\n" % (threading.current_thread(), PEER_TABLE_LOCK_HOLDER, PEER_TABLE_LOCK_TRACEBACK))

    PEER_TABLE_LOCK.acquire()
    PEER_TABLE_LOCK_HOLDER = threading.current_thread()
    PEER_TABLE_LOCK_TRACEBACK = traceback.format_stack()

    # log.debug("\n\npeer table lock held by %s at \n%s\n\n" % (PEER_TABLE_LOCK_HOLDER, PEER_TABLE_LOCK_TRACEBACK))
    return PEER_TABLE