Пример #1
0
def get_ident():
    "replacement function for thread.get_ident() which is gs-aware"
    tmp = orig_get_ident()
    if tmp in sc_elab_threads:
        cb = gs.get_current_callback()
        if cb: return cb.nr
    return tmp
Пример #2
0
def get_ident():
    "replacement function for thread.get_ident() which is gs-aware"
    tmp = orig_get_ident()
    if tmp in sc_elab_threads:
        cb = gs.get_current_callback()
        if cb:
            return cb.nr
    return tmp
Пример #3
0
def get_name():
    "function to get the name of the active gs thread if possible"
    try:
        cb = gs.get_current_callback()
        inm = cb.interpreter_name
        tnm = cb.name
        return "%s*%s" % (inm, tnm)
    except AttributeError:
        return rpdb2.threading._newname("Dummy-%d")
Пример #4
0
def get_name():
    "function to get the name of the active gs thread if possible"
    try:
        cb = gs.get_current_callback()
        inm = cb.interpreter_name
        tnm = cb.name
        return "%s*%s" % (inm, tnm)
    except AttributeError:
        return rpdb2.threading._newname("Dummy-%d")