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


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

Re: Accessing a thread

From Roedy Green <see_website@mindprod.com.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Accessing a thread
Date 2012-07-30 19:34 -0700
Organization Canadian Mind Products
Message-ID <5qge185aeqm6qdhlo6d2stnbsft4o77685@4ax.com> (permalink)
References <a7n3u2FhvtU2@mid.individual.net>

Show all headers | View raw


On Mon, 30 Jul 2012 10:54:25 +0100, Dirk Bruere at NeoPax
<dirk.bruere@gmail.com> wrote, quoted or indirectly quoted someone who
said :

>How do I access the thread lanSendThread from another class in another file?


// execute InParallel.run()
// in parallel to this thread on a new thread.
Thread t = new Thread ( new InParallel() );

// Note we call t.start(), not t.run()
// t.run() would just call run in the ordinary way.

// Get reference to the thread running this
// code right now.
Thread runningNow = Thread.currentThread();

Keep in mind a thread is busy running its own code. Pretty well
anything you run on that thread is going to be highly disruptive.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
The greatest shortcoming of the human race is our inability to understand the exponential function. 
 ~ Dr. Albert A. Bartlett (born: 1923-03-21 age: 89)
http://www.youtube.com/watch?v=F-QA2rkpBSY

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


Thread

Accessing a thread Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2012-07-30 10:54 +0100
  Re: Accessing a thread Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-07-30 09:10 -0400
  Re: Accessing a thread Roedy Green <see_website@mindprod.com.invalid> - 2012-07-30 19:34 -0700

csiph-web