$B1J0f!wCNG=!%6e9)Bg$G$9!%(B
$B$h$&$d$/>/$7;~4V$,$G$-$?$N$G!$(BThreadGroup
$B$N6/2=$r9M$($?$$$H;W$$$^$9!%(B
$B0F$r:n$C$F$_$^$7$?$N$G8f0U8+$r$$$?$@$1$k$H4r$7$$$G$9!%(B
$B%Q%C%A$OL$40$G$4$a$s$J$5$$!%(B
$B!V%Q%C%A$,$G$-$?$i9M$($k!W$H$$$&$@$1$N0U8+$G$b(B
coding $B:n6H$NM%@h=g0L$r>e$2$k%b%A%Y!<%7%g%s$K$J$j$^$9!%(B(^_^)
============================================================================
[ ThreadGroup $B$N6/2=%W%i%s(B ]
*** $B$O$8$a$K(B ***
Ruby $B$N(B ThreadGroup $B$O!$C1$J$k(B Thread
$B=89g$N@)8f$@$1$G$O$J$/!$(B
Thread $B@[email protected]$K(B ThreadGroup $B$rJQ99$G$-$k$H$$$&@-<A$K$h$j!$(B
$B<jB3$-$d(B Thread ($B@8@.$5$l$k(B sub-thread $B$r4^$(B) $B$KA
:n2DG=$JJ8L.$rM?$($?$j!$(B
$B4J0W(B sandbox $B:n@.$r;Y1g$7$?$j$9$k$3$H$b2DG=$G$"$k!%(B
$B$7$+$7$J$,$i!$8=:_$N(B ThreadGroup $B$N%a%=%C%I72(B ($B$H5!G=(B)
$B$O!$(B
$B$=$&$7$?MxMQ$r%5%]!<%H$9$k$K$O==J,$H$O8@$($J$$!%(B
$BNc$($P!$(Bthread $B72$K=hM}$rJ,;6$5$;$F7k2L$rF@$k>l9g$r9M$($k!%(B
thread $B72$r(B ThreadGroup $B$K$^$H$a$?$H$7$F$b!$(B
$B8=:$O(B ThreadGroup $BA4BN$KBP$9$k%a%=%C%I$K7g$1$k$?$a!$(B
$B7k6I$O(B thread $B72$N%j%9%H$rF@$F8DJL$K%a%=%C%I$r8F$VI,MW$,$"$k!%(B
$B$3$l$G$O$;$C$+$/(B ThreadGroup $B$r;HMQ$7$F$$$F$b!$$=$N2ACM$,Dc$$!%(B
$B$^$?!$%M%C%H%o!<%/$r2p$7$F$$$k$J$I$G(B thread
$B$,=hM}ESCf$GNc30=*N;$9$k2DG=@-$,$"$j!$(B
$B$=$N$h$&$J>l9g$O$9$0$KBeBX(B thread $B$r5/F0$9$kI,MW$,$"$k$H$9$k$H!$(B
$B%7%9%F%`$,BZ$j$J$/F0:n$9$k$K$OB??t$N(B thread
$B$Nu67$r4F;k$7B3$1$kI,MW$,$"$k!%(B
$B8=:$N(B Ruby $B$G$3$l$r9T$&$K$O(B polling
$B$G>uBV$rDI$&I,MW$,$"$j!$8zN($,0-$$(B
($B$$$D$I$N(B thread $B$,$I$&$$$&M}M3$G=*N;$9$k$+$o$+$i$J$$$N$G(B join
$B$G$OBT$F$J$$$?$a(B)$B!%(B
ThreadGroup
$B$N6/2=%W%i%s$G$O!$$=$&$7$?%1!<%9$G$N=hM}8zN(2~A1$b4^$a$k!%(B
*** $BC1=c$J(B Thread $BA`:n%a%=%C%I$NITB-(B ***
$BFCDj$N(B ThreadGroup $B$K(B Thread $B$r@8@.$9$k$K$O!$(B
Thread $B$r@8@.$7$?>e$GBP>]$N(B ThreadGroup $B$K0\F0$9$k$7$+$J$+$C$?!%(B
$B$7$+$7$=$l$G$O(B ThreadGroup $B$r0\F0$9$kA0$K(B
Thread $B$N=hM}$,?J9T$7$F$7$^$&2DG=@-$,9b$/!$(B
$B$=$l$r2sHr$9$k$?$a$K(B Thread $B$r0lC6(B stop $B$7$F$*$$$F(B
$B0\F08e$K(B wakeup $B$9$kI,MW$,$"$C$?!%(B
$B$3$NLdBj$X$NBP:v$H$7$F!$(BThreadGroup#new_thread $B$rF3F~$9$k!%(B
$B<B9T$K$O!$8=:_$N(B ThreadGroup $B$G@8@.$7$?(B thread $B$r(B
$B%l%7!<%P$N(B ThreadGroup
$B$K0\F0$9$k8"8B$r;}$D$3$H$,I,MW$G$"$k$H$9$k!%(B
$B$=$NB>!$Nc$($P(B ThreadGroup $B$KB0$9$k(B Thread
$B$9$Y$F$N=*N;$rBT$D$h$&$J%a%=%C%I(B
ThreadGroup#join $B$N$h$&$K!$(BThreadGroup $B$r(B Thread
$B=89g$H$7$FA`:n$9$k$?$a$K(B
$BITB-$H;W$($k%a%=%C%I$rDI2C$9$k!%(B
*** ThreadGroup $B$N(B dominate ***
$B8=:_$N(B ThreadGroup $B$G$O!$(Benclose $B$5$l$?>l9g$K(B
$B30It$+$i(B Thread $B$rF3F~$9$k<jCJ$,$J$$!%(B
enclose $B$H$O$=$&$$$&$b$N$@$+$i$H$$$&OC$O$"$k$,!$(B
enclose $B$5$l$?(B ThreadGroup $B$r4F;k$9$k(B Thread (ThreadGroup)
$BB&$+$i$9$k$H!$(B
$B>/!9?45v$J$$@)Ls$G$"$k!%(B
$BNc$($P!$4F;kBP>]$N(B ThreadGroup $BFb$K4IM}MQ(B Thread
$B$NN`$,I,MW$H$J$j$&$k$J$i!$(B
enclose $B$9$kA0$K$=$&$7$?(B Thread $B$r@8@.$7$F$*$/I,MW$,$"$k!%(B
$B$^$?!$$b$72?$i$+$N%H%i%V%k$G4IM}MQ(B Thread
$B$,Mn$A$F$7$^$&$H2sI|$NJ}K!$,$J$$!%(B
$B$=$3$G!$(BThreadGroup $B4V$K(B dominate $B$H$$$&4X78$r5,Dj$9$k!%(B
$B$"$k(B ThreadGroup A $B$,JL$N(B ThreadGroup B $B$r(B dominate
$B$7$F$$$k$J$i$P!$(B
A $B$KB0$9$k(B Thread $B$O!$(BB $B$K!$$"$k$$$O(B B $B$+$i(B Thread
$B$r0\F0$5$;$k$3$H$,$G$-$k!%(B
$B$?$@$7!$(BB $B$@$1$G$J$/(B Thread $B$N0\F085(B/$B0\F0@h$K$b(B A
$B$,0\F08"8B$r;}$?$M$P$J$i$J$$!%(B
Thread $B$N0\F08"8B$r;}$D$N$O(B ThreadGroup $B$NA`:n8"8B$r;}$D>l9g$G!$(B
- $BBP>]$,@)LsL5$7$N(B ThreadGroup
- $BBP>]$,(B domanated $B$G!$<+?H$,BP>]$r(B dominate $B$7$F$$$k(B
ThreadGroup $B$N(B Thread
$B$N$$$:$l$+$N>l9g$G$"$k!%(B
dominate $B$7$F$$$k(B ThreadGroup A $B$H$N4X78$r=|$$$F$O!$(B
dominate $B$5$l$F$$$k(B ThreadGroup B $B$O(B enclose
$B$5$l$F$$$k>l9g$HF1$8@)Ls$r;}$D!%(B
$B$J$!$(Bdominated $B"(B enclosed $B"*(B frozen
$B$N4X78$O0lJ}DL9T$G$"$j!$(B
$B>uBVJQ998e$O85$KLa$9$3$H$O$G$-$J$$!%(B
*** Thread $B$,;}$D%"%/%;%98"8B(B ***
$B8=:_$N(B ThreadGroup $B$K$O!$(B
ThreadGroup $B4D6-$+$i$N(B Jail Break $B$rKI$0$?$a$N(B enclose
$B$H$$$&5!9=$,$"$k$,!$(B
enclose $B$5$l$?(B ThreadGroup $BFb$N(B Thread
$B$N8"8B$K$D$$$F$O$-$A$s$H$7$?5,Dj$,$J$$!%(B
ThreadGroup $B$r(B enclose $B$9$kL\E*$O!$(BThreadGroup
$B$K$h$C$FM?$($i$l$?J8L.$+$i(B
$BITMQ0U$KN%C&$7$F$7$^$o$J$$$h$&$K$H$$$&0BA4:v$N0UL#$b$"$k$,!$(B
$BFCDj$N(B Thread $B72$r?.MQ$G$-$J$$$H$$$&%1!<%9$b$"$k$@$m$&!%(B
$B$=$&9M$($k$H!$(Benclose $B$d(B freeze $B$5$l$?(B ThreadGroup $B$+$i(B
$BB>$N(B ThreadGroup $B$KB0$9$k(B Thread
$B$rA:n$9$k$3$H$OG'$a$k$Y$-$G$O$J$$$H8@$($k!%(B $B5U$K!$$=$&$7$?A
:n$r5v$9$3$H$,$G$-$k$N$J$i!$(B
$B$o$6$o$6(B enclose $B$d(B freeze $B$r$9$kI,MW$OK3$7$$$H9M$($k!%(B
$B$h$C$F!$(Benclose $B$^$?$O(B freeze $B$5$l$?(B ThreadGroup $B$N(B
Thread $B$,!$(B
$B8"8B$N$J$$B>$N(B ThreadGroup $B$N(B Thread
$B$rA`:n$9$k$3$H$r6X;_$9$k$3$H$,K>$^$7$$!%(B
$B6qBNE*$K$O!$(BThread $B$N%$%s%9%?%s%9%a%=%C%I$NFb!$(B
[]=, abort_on_exception=, exit, kill, terminate,
priority=, raise, run, wakeup
$B$G$"$k(B ($B>uBV;2>H$O5v$9$,!$>uBVJQ99$O5v$5$J$$(B)$B!%(B
$B$7$+$7!$8_49@-$r<:$&$?$a$K$3$N@)Ls$rD>@\F3F~$9$k$3$H$OFq$7$$$@$m$&!%(B
$B$f$($K!$%G%U%)%k%H$G$O=>MhDL$j@)Ls$O$J$7$H$7$F$*$-!$(B
$B@)Ls$r@_Dj4IM}$9$k$?$a$N%a%=%C%I$H$7$F(B
ThreadGroup#lock, ThreadGroup#locked? $B$rF3F~$9$k!%(B
$B$3$N>l9g!$(Benclose $B$J$I$r$5$l$F$$$J$$(B ThreadGroup $B$K(B
$B@)Ls$rIUM?$9$k$3$H$b2DG=$G$O$"$k(B
($B%f!<%9%1!<%9$OK3$7$=$&$@$,!D(B)$B!%(B
*** ThreadGroup $B$N(B thread_queue ***
$BKAF,$G=R$Y$?$h$&$J(B polling $B$NLdBj$r2sHr$9$k$?$a$K!$(B
$B=*N;$7$?(B thread $B$r<u$1$H$k$?$a$N(B thread_queue $B$r(B ThreadGroup
$B$,;}$F$k$h$&$K$9$k!%(B
thread_queue $B$O!$=*N;$7$?(B Thread $B$r(B
$B=*N;=g$K$G$-$k$@$1Aa$/3Z$K=hM}$K$+$1$k$?$a$N5!9=$G$"$k!%(B
$B$b$A$m$s!$F0:n$5$;$k(B thread $B$N=hM}FbMF$K(B
$B=N;$r%l%]!<%H$9$k=hM}$r=q$$$F$$/$H$$$&J}K!$b$J$$$o$1$G$O$J$$$,!$(B
$B$=$l$r<BAu$9$k$H$J$k$H>/!9LLE]$G$"$m$&!%(B
$B=N;$7$?(B thread $B$,<+F0E$KFCDj$N(B queue $B$KDI2C$5$l$k$J$i(B
($B$3$N=hM}$O(B C $B%l%Y%k$G(B Coding $B$9$kI,MW$,$"$k(B)$B!$(B
$B4IM}B&$,$=$N(B queue $B$+$iFI$_=P$7$F<B9T$9$k=hM}$r=q$/$@$1$GNI$/!$(B
$BLLE]$JItJ,$r1#JC$9$k$3$H$,$G$-$k!%(B
$B4IM}BP>]$H$J$k$N$O(B Thread $B$N=89g$G$"$k$+$i!$(B
ThreadGroup $B$K$=$&$7$?(B queue $B$r;}$?$;$k$N$OBEEv$H8@$($k!%(B
thread_queue $B$O0l$D$N(B ThreadGroup $B$K$D$-0l$D$@$1$H$9$k!%(B
thread_queue $B$N%b!<%I$O!$(B(1) $B;HMQ$7$J$$!$(B(2) $BNc30$r@8$8$?(B
Thread $B$N$_$rDI2C$9$k!$(B
(3) $B$9$Y$F$N(B Thread $B$rDI2C$9$k!$$N#3<oN`$G$"$k(B
($B%G%U%)%k%H$O!V(Bthread_queue $B$r;HMQ$7$J$$!W(B)$B!%(B
$B%a%b%j>CHq$NGzH/$rHr$1$k$?$a!$%G%U%)%k%H$G$O(B thread_queue
$B$N%5%$%:$rM-8B$H$7!$(B
$BJ];}%5%$%:$rD6$($?>l9g$O8E$$(B Thread $B$+$i<N$F$k$3$H$H$9$k!%(B
thread_queue $B$N%"%/%;%9$K$O8"8B$,I,MW$G$"$k!%(B
$B<+$i$,@)Ls$r;}$?$J$$$+!$<+$i$,BP>]$N(B ThreadGroup $B$r(B dominate
$B$7$F$$$k>l9g$K8B$j!$(B
$BBP>]$N(B ThreadGroup $B$N(B thread_queue
$B$X$N%"%/%;%9$r5v$9$3$H$H$9$k!%(B
*** ThreadGroup $B$N8GM-%G!<%?(B ***
Thread $B$KJ8L.$rM?$($k$?$a$K$O(B ThreadGroup
$B$KJ8L.$r5,Dj$9$k%G!<%?$rJ];}$5$;$k!%(B
$B$b$7?7$7$$(B Thread $B$,@8@.$5$l$F$b!$<+F0E*$K8=:_$N(B ThreadGroup
$B$K=jB0$9$k$?$a!$(B
ThreadGroup $B$K$h$kJ8L.$,J];}$5$l$k(B (ThreadGroup
$B$r0\F0$9$l$P!$J8L.$bJQ99$5$l$k(B)$B!%(B
$B$3$l$^$G$O(B Thread $B$N$h$&$K(B ThreadGroup
$B$K8GM-%G!<%?$r;}$?$;$k$?$a$N%a%=%C%I$,(B
$BDj5A$5$l$F$O$$$J$+$C$?$?$a!$(BThread
$B%/%i%9F1MM$K8GM-%G!<%?$r07$&%a%=%C%I$rDI2C$9$k!%(B
*** $B%a%=%C%I0lMw(B ***
ThreadGroup.new()
ThreadGroup.new(hash)
ThreadGroup $B8GM-%G!<%?$r@_Dj$9$k0z?t$rDI2C(B
current ThreadGroup $B$r?F(B ThreadGroup $B$H$7$FJ];}$9$k(B
ThreadGroup.current
Thread.current.group $B$KF1$8(B
ThreadGroup#add(thread)
ThreadGroup#list
$B=>Mh$HF1$8(B
ThreadGroup#enclose
ThreadGroup#enclosed?
$B=>Mh$HF1$8(B
$B$?$@$7!$(Bdominated $B$G$"$l$P(B enclosed? $B$O(B true $B$H$J$k(B
ThreadGroup#lock
ThreadGroup#locked?
$BB>$N(B ThreadGroup $B$KB0$9$k(B Thread
$B$NA`:n@)Ls$N@_Dj$H>uBV;2>H(B
ThreadGroup#[]
ThreadGroup#[]=
ThreadGroup#key?(key)
ThreadGroup#keys
ThreadGroup $B8GM-%G!<%?$X$N%"%/%;%9(B
$B8=:_$N(B ThreadGroup
$B$,%l%7!<%P$NA:n8"8B$r;}$?$J$$>l9g$K$O;2>H!&JQ99$OIT5v2D(B ( $B8=:_$N(B ThreadGroup == $B%l%7!<%P$N>l9g$OA
:n8"8B$"$j(B )
ThreadGroup#new_thread(){ … }
$B%l%7!<%P$N(B ThreadGroup $B$K?7$7$$(B thread $B$r@8@.(B
(Thread.new$B$HF1$8(B)
$B0z?t$O(B Thead#new $B$HF1$8(B
$B<B9T$O!$8=:_$N(B ThreadGroup $B$+$i%l%7!<%P$X$N(B Thread
$B0\F08"8B$r;}$D$3$H$,I,MW(B
ThreadGroup#start_thread(){ … }
ThreadGroup#fork_thread(){ … }
$B%l%7!<%P$N(B ThreadGroup $B$K?7$7$$(B thread $B$r@8@.(B
(Thread.{start,fork}$B$HF1$8(B)
$B0z?t$O(B Thead#new $B$HF1$8(B
ThreadGroup#new_thread $B$H0c$C$F(B Thread#initialize $B$r8F$P$J$$(B
$B<B9T$O!$8=:_$N(B ThreadGroup $B$+$i%l%7!<%P$X$N(B Thread
$B0\F08"8B$r;}$D$3$H$,I,MW(B
ThreadGroup#dominated_by(threadgroup)
$B%l%7!<%P$r0z?t$N(B threadgroup $B$K$h$C$F(B dominate $B$9$k(B
$B%l%7!<%P$,(B enclose $B$5$l$F$$$J$1$l$P(B enclose $B$5$l$k(B
$B8=:_$N(B ThreadGroup
$B$,%l%7!<%P$H0z?t$H$NN>J}$KA`:n8"8B$r;}$?$J$1$l$PNc30$rH/@8(B
$B$b$7!$0z?t$N(B threadgroup == $B%l%7!<%P$J$i!$Nc30$rH/@8$9$k(B
ThreadGroup#dominate?(threadgroup)
$B%l%7!<%P$,(B threadgroup $B$r(B dominate $B$7$F$$$k$J$i(B true
$B$rJV$9(B
$B8=:$N(B ThreadGroup
$B$,%l%7!<%P$H0z?t$H$NA`:n8"8B$r;}$?$J$$>l9g$K$ONc30$H$J$k(B
$B8=:$N(B ThreadGroup == $B0z?t$N>l9g!$(Benclosed
$B0J>e$G$"$l$P8"8B$J$7$H$9$k(B
( enclosed $B0J>e$N(B ThreadGroup $B$,<+J,$N(B dominate
$B>uBV$rD4$Y$k$N$r6X;_$9$k$?$a(B )
ThreadGroup#dominated?
$B%l%7!<%P$r(B dominate $B$7$F$$$k(B ThreadGroup $B$rJV$9(B
$B8=:$N(B ThreadGroup
$B$,%l%7!<%P$NA`:n8"8B$r;}$?$J$$>l9g$K$ONc30$H$J$k(B
$B8=:$N(B ThreadGroup == $B%l%7!<%P$N>l9g!$(Benclosed
$B0J>e$G$"$l$P8"8B$J$7$H$9$k(B
( enclosed $B0J>e$N(B ThreadGroup $B$,<+J,$N(B dominate
$B>uBV$rD4$Y$k$N$r6X;_$9$k$?$a(B )
ThreadGroup#join(exception=false)
ThreadGroup#join(limit, exception=false))
ThreadGroup $B$N$9$Y$F$N(B thread $B$,=*N;$9$k$N$rBT$D(B
$B0z?t(B limit ($BICC10L$N?tCM(B) $B$,;XDj$5$l$F$$$l$P!$$=$N;~4V$G(B
timeout $B$9$k(B
join $B$r8F$s$@8e$K@8@.$5$l$?(B thread $B$G$"$C$F$b=*N;$rBT$D(B
$B=*N;$7$?(B thread $B$rG[Ns$K$7$FJV$9(B
$B0z?t(B exception $B$K$D$$$F$O!$(B
nil $B$G$"$k$H$-$O!$Nc30$r@8$8$?(B thread $B$OGK4~$7$F$=$l0J30$N(B
hread $B$N$_$rJV$9(B
true $B$G$"$k$H$-$O!$Nc30$NM-L5$K8B$i$:$9$Y$F$N(B thread
$B$rLa$jCM$NG[Ns$K4^$a$k!%(B
false $B$N$H$-$O!$Nc30$r@8$8$?(B thread
$B$K=P2q$C$?;~E@$G$=$NNc30$rH/@8$5$;$k(B
ThreadGroup#values(exceptions=false)
$B$9$Y$F$N(B thread $B$NLa$jCM$rG[Ns$K$7$FJV$9(B
$BCM$H(B thread $B$H$NBP1~$,<h$l$J$$$N$G!$CM$@$1$,I,MW$J>l9g$KMQ$$$k(B
thread $B$H$NBP1~$,I,MW$J$i!$(Bjoin $B$GF@$?(B thread
$B$NG[Ns$KBP$7$F(B each $B$9$k$3$H(B
$B0z?t$,(B nil $B$G$"$k$H$-$O!$Nc30$r@8$8$?(B thread
$B$OGK4~$7$F$=$l0J30$NLa$jCM$N$_$rJV$9(B
$B0z?t$,(B true
$B$G$"$k$H$-$O!$Nc30$ONc30%*%V%8%’%/%H$H$7$FLa$jCM$NG[Ns$K4^$a$k!%(B
$B0z?t$,(B false $B$N$H$-$O!$Nc30$r@8$8$?(B thread
$B$K=P2q$C$?;~E@$G$=$NNc30$rH/@8$5$;$k(B
ThreadGroup#exit
ThreadGroup#kill
ThreadGroup#terminate
ThreadGroup $B$N$9$Y$F$N(B thread $B$r(B terminate $B$9$k(B
kill $B$r8F$s$@8e$K@8@.$5$l$?(B thread $B$G$"$C$F$b(B terminate
$B$9$k(B
$B<BBN$O$3$s$J46$8(B
current = Thread.current
Thread.exclusive do
until((lst = self.list - current).empty?) do
lst.each {|th| th.kill}
end
end
current.kill if current.group == self
ThreadGroup#thread_queue_pop(non_block=false)
thread queue $B$+$i=*N;$7$?(B thread $B$r0l$D<h$j=P$9(B
ThreadGroup#thread_queue_mode
ThreadGroup#thread_queue_mode=(mode)
$B=*N;$7$?(B thread $B$rC_$($k(B thread queue $B$N%b!<%I$N3NG’$H@Dj(B
nil : $B=*N;$7$?(B thread $B$rC$($J$$(B ($B=>Mh$HF1MM$N>uBV(B)
false or :exception : $BNc30$G=*N;$7$?(B thread $B$@$1$rC_$($k(B
true or :all : $B=*N;$7$?(B thread $B$r$9$Y$FC_$($k(B
ThreadGroup#thread_queue_length
ThreadGroup#thread_queue_length=(len)
ThreadGroup#thread_queue_limit
ThreadGroup#thread_queue_limit=(len)
thread queue $B$N:GBgD9$r;2>H!&@_Dj$9$k(B
thread $B?t$NGzH/$rKI$0$?$a$N$b$N(B
$B:GBgD9$rD6$($k>l9g$O8E$$(B thread $B$+$i<N$F$i$l$k(B
$B%G%U%)%k%H$ND9$5$O!$G[Ns$N%G%U%)%k%HD9$5$HF1$8(B 16 $B$H$7$F$*$/(B
ThreadGroup#abort_on_exception
ThreadGroup#abort_on_exception=(state)
TreadGroup $BFb$N(B thread
$B$G$NNc30H/@8;~$K%$%s%?%W%j%?<+BN$r=*N;$5$;$k$+H]$+(B
ThreadGroup#raise
$B8=:_(B ThreadGroup $B$K=jB0$9$k$9$Y$F$N(B thread
$B$KNc30$rH/@8$5$;$k(B
$B?7$?$K@8@.$5$l$?(B thread
$B$K$^$GNc30$rH/@8$5$;$kI,MW$O$J$5$=$&$J$N$G!"(B
$B<BBN$O(B Thread.exclusive{threadgroup.list.each{|th| th.raise(…)}}
$B$H$9$k(B
ThreadGroup#alive?
$B8=:(B ThreadGroup $B$K=jB0$9$k(B thread $B$,B8:$9$l$P(B true
$B<BBN$O(B threadgroup.list.empty? $B$H$9$k(B
ThreadGroup#wakeup
$B8=:_(B ThreadGroup $B$K=jB0$9$k(B thread $B$N$9$Y$F$r5/$3$9(B
$B<BBN$OC1=c$K(B Thread.exclusive{threadgroup.list.each{|th|
th.wakeup}} $B$H$9$k(B
*** ThreadGroup $B$K$ODj5A$7$J$$M=Dj$N%a%=%C%I(B ***
Thread $B$K$"$k%a%=%C%I$NFb!$0J2<$O(B ThreadGroup
$B$G$N5!G=Dj5A$,Fq$7$$$N$G(B
$BF3F~$7$J$$M=Dj$G$"$k!%(B
ThreadGroup#value
$BJ#?t$N(B Thread $B$,BP>]$H$J$k$N$G!$(BThreadGroup#values $B$GDj5A(B
ThreadGroup#run
$B8=:(B ThreadGroup $B$K=jB0$9$k(B thread $B$N$9$Y$F$r5/$3$9(B
wakeup $B$O0UL#$,$"$k$H;W$&$,!$(Brun $B$O5?Ld(B
($B$I$l$K@)8f$r0$9$Y$-$+$,5,DjITG=(B)
$B8=:$N(B thread list $B$K=g<!(B run
$B$r$+$1$k$H$$$&7A$O$"$jF@$k$,!%!%!%(B