X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=blobdiff_plain;f=t%2F09-load-threads.t;h=4652ab9f7d489da70bf7fe3381176df6a0be7904;hp=7575b2dcec583f2304a079ee7fdb473517d9eb10;hb=4838c6541e1f54c7c8b12def045ee6517c1199c9;hpb=d2cd883c29f9c0629c86334291d90531150dccf2 diff --git a/t/09-load-threads.t b/t/09-load-threads.t index 7575b2d..4652ab9 100644 --- a/t/09-load-threads.t +++ b/t/09-load-threads.t @@ -182,7 +182,7 @@ is_loaded 0, 'main body, after nested loadings'; use threads; use threads::shared; -my @locks_down = (1) x 5; +my @locks_down = (1) x 6; my @locks_up = (0) x scalar @locks_down; share($_) for @locks_down, @locks_up; @@ -221,17 +221,19 @@ sub sync_slave { SKIP: { my $thr1 = spawn(sub { my $here = 'first simultaneous thread'; - is_loaded 0, "$here, beginning"; sync_slave 0; + is_loaded 0, "$here, beginning"; + sync_slave 1; + do_load; is_loaded 1, "$here, after loading"; - sync_slave 1; sync_slave 2; - sync_slave 3; - is_loaded 1, "$here, still loaded while also loaded in the other thread"; + sync_slave 4; + is_loaded 1, "$here, still loaded while also loaded in the other thread"; + sync_slave 5; is_loaded 1, "$here, end"; @@ -242,17 +244,19 @@ SKIP: { my $thr2 = spawn(sub { my $here = 'second simultaneous thread'; - is_loaded 0, "$here, beginning"; sync_slave 0; + is_loaded 0, "$here, beginning"; sync_slave 1; - is_loaded 0, "$here, loaded in other thread but not here"; + sync_slave 2; + sync_slave 3; + is_loaded 0, "$here, loaded in other thread but not here"; do_load; is_loaded 1, "$here, after loading"; - sync_slave 3; sync_slave 4; + sync_slave 5; is_loaded 1, "$here, end";