app/server/sonicpi/lib/sonicpi/spider.rb
# Synchronise on the promise. This means that we block this new
# thread until we're absolutly sure it's been registered with the
# parent thread as a thread local var. If the promise isn't
# delivered within 10s, we assume the parent thread has been killed
# so we abort running this thread.
Synchronise on the promise. This means that we block this new
thread until we're absolutly sure it's been registered with the
parent thread as a thread local var. If the promise isn't
delivered within 10s, we assume the parent thread has been killed
so we abort running this thread.
Synchronise on the promise . This means that we block this new thread until we ' re absolutly sure it ' s been registered with the parent thread as a thread local var . If the promise isn ' t delivered within 10s we assume the parent thread has been killed so we abort running this thread .
def wait_for_parent_thread!(parent_t, prom)
      begin
        prom.get(10)
      rescue
        raise "Parent thread died!" unless parent_t.alive?
        wait_for_parent_thread!(parent_t, prom)
      end
    end
def wait_for_parent_thread! ( parent_t , prom ) begin prom . get ( 10 ) rescue raise "Parent thread died!" unless parent_t . alive? wait_for_parent_thread! ( parent_t , prom ) end end
Synchronise on the promise.
Synchronise on the promise .
parent_t
<not_specific>
prom
<not_specific>