Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!transit4.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!53ab2750!not-for-mail From: "Dirk Bruere at NeoPax" Subject: Re: Accessing a thread Message-ID: <501C156A.56053.calajapr@time.synchro.net> X-Comment-To: All Newsgroups: comp.lang.java.programmer X-FTN-AREA: COMP.LANG.JAVA.PROGRAMMER X-FTN-MSGID: 1:261/38 f13d4552 Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.16a-Win32 NewsLink 1.98] Lines: 49 Date: Fri, 03 Aug 2012 18:54:23 GMT NNTP-Posting-Host: 69.21.70.65 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1344020063 69.21.70.65 (Fri, 03 Aug 2012 13:54:23 CDT) NNTP-Posting-Date: Fri, 03 Aug 2012 13:54:23 CDT Organization: tds.net Xref: csiph.com comp.lang.java.programmer:17094 From: Dirk Bruere at NeoPax On 31/07/2012 21:07, Roedy Green wrote: > To: Dirk Bruere at NeoPax > From: "Roedy Green" > > To: Dirk Bruere at NeoPax > From: Roedy Green > > On Mon, 30 Jul 2012 10:54:25 +0100, Dirk Bruere at NeoPax > 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(); I still don't see how this solves my problem. In "main" (controller) I have: public static Thread txToLanThreadRef; TxToLanThread txToLanThread = new TxToLanThread(); txToLanThread.start(); txToLanThreadRef = txToLanThread.runningNow; However, when I try to access it elsewhere, this does not work controller.txToLanThreadRef. I need to access the handler in the thread so I can send it a message -- Dirk Full Spectrum Praxis : ZERO STATE : http://zerostate.net --- BBBS/Li6 v4.10 Dada-1 * Origin: Prism bbs (1:261/38) --- Synchronet 3.16a-Win32 NewsLink 1.98 Time Warp of the Future BBS - telnet://time.synchro.net:24