#NEWLINE# def test_multi_thread_multi_scatter( ) : #NEWLINE# #INDENT# with ephemeral_context ( ) as context : #NEWLINE# #INDENT# gather = GatherProcess ( ) #NEWLINE# context . spawn ( gather ) #NEWLINE# scatters = [ ScatterThread ( gather . pid , 3 , Context ( ) ) for k in range ( 5 ) ] #NEWLINE# for scatter in scatters : #NEWLINE# #INDENT# scatter . context . start ( ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# startjoin ( context , scatters ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# for scatter in scatters : #NEWLINE# #INDENT# scatter . context . stop ( )