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


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

Re: Accessing a thread

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Dirk Bruere at NeoPax <dirk.bruere@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: Accessing a thread
Date Fri, 03 Aug 2012 16:52:42 +0100
Organization Dirk Bruere at Neopax
Lines 44
Message-ID <a82ae4F5osU1@mid.individual.net> (permalink)
References <50181D60.55729.calajapr@time.synchro.net> <50182C82.55850.calajapr@time.synchro.net>
Reply-To dirk.bruere@gmail.com
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net 3loHebyYdcb16zZ9W5ZXrw++TRICe6eZwfPLNv8AFldUi7MfF31XhL/PjlTnBMHEsx
Cancel-Lock sha1:eBAOqIKWhAHbE3UDQpSCP81LRbc=
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1
In-Reply-To <50182C82.55850.calajapr@time.synchro.net>
X-Antivirus avast! (VPS 120803-0, 03/08/2012), Outbound message
X-Antivirus-Status Clean
Xref csiph.com comp.lang.java.programmer:17037

Show key headers only | View raw


On 31/07/2012 21:07, Roedy Green wrote:
>    To: Dirk Bruere at NeoPax
> From: "Roedy Green"<roedy.green@1:261/38.remove-dpk-this>
>
>    To: Dirk Bruere at NeoPax
> From: Roedy Green<see_website@mindprod.com.invalid>
>
> 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();

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

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


Thread

Accessing a thread "Dirk Bruere at NeoPax" <dirk.bruere.at.neopax@1:261/38.remove-dpk-this> - 2012-07-31 18:02 +0000
  Re: Accessing a thread "Eric Sosman" <eric.sosman@1:261/38.remove-dpk-this> - 2012-07-31 18:02 +0000
    Re: Accessing a thread "Dirk Bruere at NeoPax" <dirk.bruere.at.neopax@1:261/38.remove-dpk-this> - 2012-07-31 18:02 +0000
  Re: Accessing a thread "Roedy Green" <roedy.green@1:261/38.remove-x1c-this> - 2012-07-31 20:07 +0000
    Re: Accessing a thread Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2012-08-03 16:52 +0100
      Re: Accessing a thread markspace <-@.> - 2012-08-03 10:07 -0700

csiph-web