[concurrency-interest] Does "Thread.stop" do what is says it does?

David Holmes dholmes at dltech.com.au
Thu Aug 4 21:39:09 EDT 2005


> Replying to myself: the observed behavior seems to be that stop followed
> by start does not cause immediate thread termination, so I guess I
> report it here as a bug. (I guess it should be "if (this.getState() ==
> TERMINATED) return;" or something equivalent).

There is a lot of history here and numerous bugs concerning the incorrect
behaviour of "still born" threads - ones which have been stopped before they
started. Back in 1.1 it worked as advertised, but there was a different bug
whereby once stop() had been called then isAlive() returned false even
though the thread was not terminated. In 1.2 if I recall correctly they
fixed the isAlive problem, broke the still-born behaviour and deprecated the
stop method. So thereafter any bug reports concerning this were flagged as
"will not fix as it concerns a deprecated method". Not sure what bugs are
still present in the bug parade.

In short you cannot rely on Thread.stop doing anything per its documentation
these days.

David Holmes

More information about the Concurrency-interest mailing list