Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #29887

Re: refusal to quit

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail
From Roedy Green <see_website@mindprod.com.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: refusal to quit
Date Mon, 01 Sep 2014 14:34:50 -0700
Organization Canadian Mind Products
Lines 24
Message-ID <4ep90a55sd12b8vn5026iqb919m16lp5uf@4ax.com> (permalink)
References <u1c10ap9r3l11teuhngbr5on958vu8h2vj@4ax.com> <7lo90apm56ne18c2fl7nk2o2adqghe0mkq@4ax.com>
Reply-To Roedy Green <see_website@mindprod.com.invalid>
NNTP-Posting-Host K2Qzzs3EAqXk5RLzfhxcSw.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent ForteAgent/7.20.32.1218
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.lang.java.programmer:29887

Show key headers only | View raw


On Mon, 01 Sep 2014 14:20:32 -0700, Roedy Green
<see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted
someone who said :

>In one case it said that a Timer was still running.  I thought
>Timer.cancel would be sufficient to kill it, but apparently not.
>I gather it just stops the periodic calls to run, but leaves the
>thread alive.
I found a work-around for that.
Instead of Timer, I used:

   ScheduledExecutorService scheduler;
...
   scheduler = Executors.newSingleThreadScheduledExecutor();
   scheduler.scheduleAtFixedRate( aRunnable, 5, 5, TimeUnit.SECONDS );
...
   // shutdown that kills both timer and thread     
   scheduler.shutdownNow();
       
   
-- 
Roedy Green Canadian Mind Products http://mindprod.com
Errors using inadequate data are much less than those using no data at all. 
~ Charles Babbage (born: 1791-12-26 died: 1871-10-18 at age: 79)

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

refusal to quit Roedy Green <see_website@mindprod.com.invalid> - 2014-08-29 09:56 -0700
  Re: refusal to quit Mike Amling <mamling@chaff.us> - 2014-08-29 12:50 -0500
    Re: refusal to quit Roedy Green <see_website@mindprod.com.invalid> - 2014-08-31 11:31 -0700
      Re: refusal to quit Josip Almasi <joe@vrspace.org> - 2014-09-01 17:14 +0200
        Re: refusal to quit Roedy Green <see_website@mindprod.com.invalid> - 2014-09-01 16:37 -0700
  Re: refusal to quit Josip Almasi <joe@vrspace.org> - 2014-08-29 22:16 +0200
    Re: refusal to quit Roedy Green <see_website@mindprod.com.invalid> - 2014-08-31 11:32 -0700
      Re: refusal to quit Josip Almasi <joe@vrspace.org> - 2014-09-01 17:20 +0200
  Re: refusal to quit Knute Johnson <eternal@knutejohnson.com> - 2014-08-29 17:25 -0700
  Re: refusal to quit Roedy Green <see_website@mindprod.com.invalid> - 2014-09-01 14:20 -0700
    Re: refusal to quit Roedy Green <see_website@mindprod.com.invalid> - 2014-09-01 14:34 -0700
    Re: refusal to quit Josip Almasi <joe@vrspace.org> - 2014-09-02 10:49 +0200
    Re: refusal to quit Arne Vajhøj <arne@vajhoej.dk> - 2014-09-07 22:04 -0400
  Re: refusal to quit Jan Burse <janburse@fastmail.fm> - 2014-09-02 12:17 +0200

csiph-web