@@ -2301,9 +2301,6 @@ def live_loop(name=nil, *args, &block)
2301
2301
2302
2302
start_live_loop = Promise . new
2303
2303
parent_thread = Thread . current
2304
- # lg ""
2305
- # lg "live_loop creation w/: #{Thread.current.object_id} -> #{__system_thread_locals.get(:sonic_pi_local_parent_thread).object_id}"
2306
- # lg "======================"
2307
2304
mk_live_loop = lambda do
2308
2305
in_thread ( name : ll_name , delay : delay , sync : sync_sym , sync_bpm : sync_bpm_sym ) do
2309
2306
@@ -2314,7 +2311,6 @@ def live_loop(name=nil, *args, &block)
2314
2311
else
2315
2312
res = 0
2316
2313
end
2317
- lg "LL #{ name } - started - [#{ Thread . current . object_id } ] -> #{ __system_thread_locals . get ( :sonic_pi_local_parent_thread ) . object_id } "
2318
2314
use_random_seed args_h [ :seed ] if args_h [ :seed ]
2319
2315
2320
2316
loop do
@@ -2340,31 +2336,15 @@ def live_loop(name=nil, *args, &block)
2340
2336
old_bus = __system_thread_locals . get :sonic_pi_mod_sound_synth_out_bus
2341
2337
__system_thread_locals . set ( :sonic_pi_mod_sound_synth_out_bus , new_bus )
2342
2338
__system_thread_locals . set ( :sonic_pi_mod_sound_job_group , new_group )
2343
-
2344
- lg ""
2345
- lg "live_loop #{ Thread . current . object_id } "
2346
- lg " - parent: #{ __system_thread_locals . get ( :sonic_pi_local_parent_thread ) . object_id } "
2347
- lg " - sending moved signal"
2348
- lg " - moved bus from #{ old_bus } -> #{ new_bus } "
2349
- lg " - move completed ack: #{ ack_prom . object_id } "
2350
- lg ""
2351
2339
moved_prom . deliver! tracker
2352
- lg "....waiting for ack"
2353
2340
ack_prom . get
2354
- lg "....got ack"
2355
2341
__system_thread_locals . set_local :sonic_pi_local_spider_thread_moved , new_thread_moved_prom
2356
2342
__system_thread_locals . set_local :sonic_pi_local_spider_thread_moved_ack , new_thread_moved_ack_prom
2357
2343
__system_thread_locals . set_local :sonic_pi_local_live_loop_move_to_bus_and_parent_t , nil
2358
2344
new_job_id = __system_thread_locals ( new_parent_t ) . get ( :sonic_pi_spider_job_id )
2359
2345
job_subthread_move_named ( Thread . current , new_job_id , ll_name )
2360
2346
__remove_thread_from_parent_subthreads! ( Thread . current )
2361
2347
__move_thread_to_new_parent! ( Thread . current , new_parent_t )
2362
- lg ""
2363
- lg "live_loop #{ Thread . current . object_id } "
2364
- lg " - parent: #{ __system_thread_locals . get ( :sonic_pi_local_parent_thread ) . object_id } "
2365
- lg " - moved to bus: #{ current_out_bus } "
2366
-
2367
- lg ""
2368
2348
completed_prom . deliver! :moved
2369
2349
end
2370
2350
__live_loop_cue name if __system_thread_locals . get :sonic_pi_local_live_loop_auto_cue
@@ -2389,7 +2369,6 @@ def live_loop(name=nil, *args, &block)
2389
2369
move_holding_thread_prom = Promise . new
2390
2370
Thread . new do
2391
2371
__system_thread_locals . set_local :sonic_pi_local_thread_group , "ll swapper and holding thread for #{ name } #{ st } "
2392
- lg "LL[#{ Thread . current . object_id } ] #{ name } - move - [#{ st . object_id } ] -> #{ parent_thread . object_id } - ST:#{ Thread . current . object_id } "
2393
2372
completed_prom = Promise . new
2394
2373
2395
2374
@@ -2399,7 +2378,6 @@ def live_loop(name=nil, *args, &block)
2399
2378
2400
2379
_b , _g , t , p = __system_thread_locals ( st ) . get ( :sonic_pi_local_live_loop_move_to_bus_and_parent_t )
2401
2380
if p
2402
- lg "CLOBBERING #{ t . object_id } #{ __system_thread_locals ( t ) . get ( :sonic_pi_local_thread_group ) } #{ p . object_id } "
2403
2381
## another live loop already registered a move, but didn't manage to swap in time - so we're going to clobber it
2404
2382
p . deliver! :clobbered
2405
2383
end
@@ -2421,8 +2399,6 @@ def live_loop(name=nil, *args, &block)
2421
2399
ct2 . kill
2422
2400
2423
2401
if moved_or_clobbered == :moved
2424
- lg "LL[#{ Thread . current . object_id } ] #{ name } - moved - [#{ st . object_id } ] - ST:#{ Thread . current . object_id } "
2425
-
2426
2402
st_joined_or_moved_again = Promise . new
2427
2403
mt1 = Thread . new do
2428
2404
__system_thread_locals . set_local :sonic_pi_local_thread_group , "ll join waiter for #{ name } #{ st . object_id } #{ __system_thread_locals ( st ) . get ( :sonic_pi_local_thread_group ) } "
@@ -2434,17 +2410,12 @@ def live_loop(name=nil, *args, &block)
2434
2410
__system_thread_locals . set_local :sonic_pi_local_thread_group , "ll move waiter for #{ name } #{ st . object_id } #{ __system_thread_locals ( st ) . get ( :sonic_pi_local_thread_group ) } "
2435
2411
2436
2412
ack_p = __system_thread_locals ( st ) . get ( :sonic_pi_local_spider_thread_moved_ack )
2437
- lg "LL[#{ Thread . current . object_id } ] #{ name } - waiting for move again - [#{ st . object_id } ] - ack_p: #{ ack_p . object_id } "
2438
2413
ack_p . get
2439
2414
st_joined_or_moved_again . deliver! true , false
2440
2415
end
2441
- lg "LL[#{ Thread . current . object_id } ] #{ name } - KA - [#{ st . object_id } ] -> #{ parent_thread . object_id } - ST:#{ Thread . current . object_id } "
2442
2416
st_joined_or_moved_again . get
2443
- lg "LL[#{ Thread . current . object_id } ] #{ name } - Done - [#{ st . object_id } ] -> #{ parent_thread . object_id } - ST:#{ Thread . current . object_id } "
2444
2417
mt1 . kill
2445
2418
mt2 . kill
2446
- else
2447
- lg "LL[#{ Thread . current . object_id } ] #{ name } - clobbered - [#{ st . object_id } ] - ST:#{ Thread . current . object_id } "
2448
2419
end
2449
2420
move_holding_thread_prom . deliver! true
2450
2421
end
0 commit comments