Beispiel #1
0
def do_yield_thread():
    # explicitly release the gil, in a way that tries to give more
    # priority to other threads (as opposed to continuing to run in
    # the same thread).
    if rthread.gil_yield_thread():
        rthread.gc_thread_run()
        after_thread_switch()
Beispiel #2
0
def do_yield_thread():
    # explicitly release the gil, in a way that tries to give more
    # priority to other threads (as opposed to continuing to run in
    # the same thread).
    if rgil.gil_yield_thread():
        rthread.gc_thread_run()
        after_thread_switch()
Beispiel #3
0
def yield_thread():
    # explicitly release the gil, in a way that tries to give more
    # priority to other threads (as opposed to continuing to run in
    # the same thread).
    if _gil_yield_thread():
        from rpython.rlib import rthread
        rthread.gc_thread_run()
        _after_thread_switch()
Beispiel #4
0
def yield_thread():
    # explicitly release the gil, in a way that tries to give more
    # priority to other threads (as opposed to continuing to run in
    # the same thread).
    if _gil_yield_thread():
        from rpython.rlib import rthread
        rthread.gc_thread_run()
        _after_thread_switch()
Beispiel #5
0
def acquire_maybe_in_new_thread():
    if not we_are_translated():
        return acquire()
    from rpython.rlib import rthread
    rthread.get_or_make_ident(
    )  #make sure that the threadlocals are initialized
    _gil_acquire()
    rthread.gc_thread_run()
    _after_thread_switch()
Beispiel #6
0
def acquire():
    if we_are_translated():
        from rpython.rlib import rthread
        _gil_acquire()
        rthread.gc_thread_run()
    else:
        allocate()
        _emulated_gil_holder.acquire()
    _after_thread_switch()
Beispiel #7
0
def after_external_call():
    e = get_errno()
    rthread.gil_acquire()
    rthread.gc_thread_run()
    after_thread_switch()
    set_errno(e)
Beispiel #8
0
 def after():
     rthread.acquire_NOAUTO(state.ll_lock, True)
     rthread.gc_thread_run()
Beispiel #9
0
def after_external_call():
    rgil.gil_acquire()
    rthread.gc_thread_run()
    after_thread_switch()
Beispiel #10
0
 def after():
     rthread.acquire_NOAUTO(state.ll_lock, True)
     rthread.gc_thread_run()
Beispiel #11
0
def after_external_call():
    rgil.gil_acquire()
    rthread.gc_thread_run()
    after_thread_switch()
Beispiel #12
0
def acquire():
    from rpython.rlib import rthread
    _gil_acquire()
    rthread.gc_thread_run()
    _after_thread_switch()
Beispiel #13
0
def acquire():
    from rpython.rlib import rthread
    _gil_acquire()
    rthread.gc_thread_run()
    _after_thread_switch()
Beispiel #14
0
def after_external_call():
    e = get_errno()
    rgil.gil_acquire()
    rthread.gc_thread_run()
    after_thread_switch()
    set_errno(e)