My understanding is that the folks at Sun considered Thread.stop() to be
somewhat unstable (please correct me if I'm wrong) and therefore deprecated
it.  What they suggested in the JDK1.2 documentation is that you allow the
Thread.run() method to normally end to stop the thread.  Thus, you would
need to set some class variable that the run method would need to check
periodically to see if it should keep going.  Hope this helps.


-Andy


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 13, 1998 10:15 AM
> To: [EMAIL PROTECTED]
> Subject: Deprecated `Thread.stop()' in forthcoming JDK 1.2. Why?
>
>
>      I read somewhere that Thread.stop() is now deprecated. Now how on
>      earth do we stop a thread ?
>      I thought the solution would be Thread.interrupt()
>      but that only works when the thread is sleeping, at least in JDK 1.1
>      documentation.
>
>      I do not have the JDK 1.2 to hand, and I have started use multiple
>      threads in Swing/JFC/. It seems to be idiocy to have a start method
>      and not have a stop method. The stop() method justs halts the thread
>      object and the garbage collector collects any rubbish.
>
>      Thoughts?
>
>      Pete
>
>

Reply via email to