$B2CF#$5$s!#(B<div><br></div><div>$B6b@.$G$9!#(B</div><div>$B$42sEz$"$j$,$H$&$4$6$$$^$9!#(B</div><div><br></div><div>$BC1=c$K(BTaskA.doExecute$B$rF14|2=$9$l$PLdBj$J$+$C$?$N$G$9$M!#(B</div><div>$B:rF|$4;XE&D:$$$?J}K!$G$N<B9T3NG'$r9T$C$?$N$G!"Js9pCW$7$^$9!#(B</div><div><br></div><div>$B<B9T3NG'$r9T$$$^$7$?$,!"(B</div><div>$BLdBj$J$/F0:nCW$7$^$9(B($B8=;~E@$G$O!"%3%s%=!<%k=PNO%l%Y%k$N3NG'$G$9(B)$B!#(B</div>
<div><br></div><div>$B0J2<!";HMQ$7$?%=!<%9$N(BdoExecute$B%a%=%C%IItJ,$G$9!#(B</div><div><br></div><div>ATask.java</div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>public synchronized void doExecute() {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>System.out.println(&quot;ATask$B<B9T(B : &quot;);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>pause.set( ! pause.get());</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>this.notify();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div>
<div><br></div><div>BTask.java</div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>public void doExecute() {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>int count = 0;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>while(count++ &lt; &nbsp;9000000) {</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>System.out.println(&quot;BTask$B<B9TCf(B : &quot; + count);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>waitProcess();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div>
<div><br></div><div>$B59$7$/$*4j$$CW$7$^$9!#(B</div></div></div><div><br></div><div><br><div class="gmail_quote">2009/07/29 17:23 Junichi Kato <span dir="ltr">&lt;<a href="mailto:j5ik2o@gmail.com">j5ik2o@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
$B6b@.$5$s(B<br>
$B2CF#$G$9!#(B<br>
<br>
public synchronized void doExecute() {<br>
<div class="im"> &nbsp; &nbsp; &nbsp; &nbsp;System.out.println(&quot;ATask$B<B9T(B : &quot;);<br>
 &nbsp; &nbsp; &nbsp; &nbsp;pause.set( ! pause.get() );<br>
 &nbsp; &nbsp; &nbsp; &nbsp;this.notify();<br>
}<br>
<br>
</div>$B$H$9$k$H$&$^$/$$$/$H;W$&$s$G$9$,!"$I$&$G$7$g$&$+!#(B<br>
$B$h$m$7$/$*4j$$$7$^$9!#(B<br>
<br>
2009/07/29 10:25 $B$K(B kanari takuma&lt;<a href="mailto:omitmyself.t@gmail.com">omitmyself.t@gmail.com</a>&gt; $B$5$s$O=q$-$^$7$?(B:<br>
<div><div></div><div class="h5">&gt; $B2CF#$5$s(B<br>
&gt; $B6b@.$G$9!#(B<br>
&gt; $B$42sEz$"$j$,$H$&$4$6$$$^$9!#(B<br>
&gt; $BAaB.$G$9$,!"(B<br>
&gt; $B:rF|$4;XE&D:$$$?<BAuJ}K!$G!"F0:n3NG'$r9T$$$^$7$?$N$G!"Js9pCW$7$^$9!#(B<br>
&gt; $B0J2<!";HMQ$7$?%/%i%9$N(BdoExecute$BItJ,$G$9!#(B<br>
&gt; $B!&(BATask(CRON)<br>
&gt; public BTask bTask;<br>
&gt; private AtomicBoolean pause = new AtomicBoolean();<br>
&gt; -- $BCfN,(B --<br>
&gt; public void doExecute() {<br>
&gt; System.out.println(&quot;ATask$B<B9T(B : &quot;);<br>
&gt; pause.set( ! pause.get() );<br>
&gt; this.notify();<br>
&gt; }<br>
&gt; (AbstractPausableTask$BFb$G(Bpause$B$,(Bnull$B$K$J$C$F$7$^$&$?$a!"(B<br>
&gt; ATask$B$N(Bpause$B$N@k8@$r!"(Bprivate AtomicBoolean pause;<br>
&gt; $B"*(B private AtomicBoolean pause = new AtomicBoolean();<br>
&gt; $B$KJQ99$7$F!"(BAbstractPausableTask.setPause$B$r8F$S=P$9$h$&$K=$@5$7$^$7$?!#(B)<br>
&gt; $B!&(BBTask(NonDelayTrigger)<br>
&gt; public void doExecute() {<br>
&gt; int count = 0;<br>
&gt; while(count++ &lt; &nbsp;9000000) {<br>
&gt; System.out.println(&quot;BTask$B<B9TCf(B : &quot; + count);<br>
&gt; waitProcess();<br>
&gt; }<br>
&gt; }<br>
&gt; $B!&(BAbstractPausableTask$B$KJQ99$O$"$j$^$;$s!#(B<br>
&gt; $B$3$N%?%9%/$r<B9T$7$?7k2L!"(B<br>
&gt; ATask.doExucete$B$G$N!"(Bnotify$B$r8F$S=P$7;~$K!"(B<br>
&gt; IllegalMonitorStateException$B$,H/@8$7$^$9!#(B<br>
&gt; $B%9%l%C%IE*$KNI$/$J$$$H;W$&$N$G$9$,!"(B<br>
&gt; notify$B$r8F$P$J$1$l$P!"@5>o$K0l;~Dd;_!":F3+$,2DG=$G$7$?!#(B<br>
&gt; ($BNc$($P!"(BAbstractPausableTask$BFb$G!"(BpauseObject$B$N(Bnofity$B$^$GA`:n$9$k$N$O!"(B<br>
&gt; $B$"$^$j%9%^!<%H$J$d$jJ}$G$O$J$$$N$G$7$g$&$+!#(B)<br>
&gt; $B<B9TJ}K!$KLdBjE@Ey$4$6$$$^$7$?$i!"$4;XE&2<$5$$!#(B<br>
&gt; $B59$7$/$*4j$$CW$7$^$9!#(B<br>
&gt;<br>
&gt;<br>
</div></div><div><div></div><div class="h5">&gt; _______________________________________________<br>
&gt; Seasar-user mailing list<br>
&gt; <a href="mailto:Seasar-user@ml.seasar.org">Seasar-user@ml.seasar.org</a><br>
&gt; <a href="https://ml.seasar.org/mailman/listinfo/seasar-user" target="_blank">https://ml.seasar.org/mailman/listinfo/seasar-user</a><br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
--<br>
/**<br>
&nbsp;* name &nbsp;: Junichi Kato<br>
&nbsp;* email : <a href="mailto:j5ik2o@gmail.com">j5ik2o@gmail.com</a><br>
&nbsp;*<br>
&nbsp;* blog &nbsp;: <a href="http://d.hatena.ne.jp/j5ik2o/" target="_blank">http://d.hatena.ne.jp/j5ik2o/</a><br>
&nbsp;*<br>
&nbsp;* commiting projects :<br>
&nbsp;* <a href="http://jiemamy.org/" target="_blank">http://jiemamy.org/</a><br>
&nbsp;* <a href="http://s2chronos.sandbox.seasar.org/" target="_blank">http://s2chronos.sandbox.seasar.org/</a><br>
&nbsp;* <a href="http://s2config.sandbox.seasar.org/" target="_blank">http://s2config.sandbox.seasar.org/</a><br>
&nbsp;*/<br>
_______________________________________________<br>
Seasar-user mailing list<br>
<a href="mailto:Seasar-user@ml.seasar.org">Seasar-user@ml.seasar.org</a><br>
<a href="https://ml.seasar.org/mailman/listinfo/seasar-user" target="_blank">https://ml.seasar.org/mailman/listinfo/seasar-user</a><br>
</div></div></blockquote></div><br></div>