Guest User

Untitled

a guest
Nov 14th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. @deprecated This method is inherently unsafe. Stopping a thread with
  2. * Thread.stop causes it to unlock all of the monitors that it
  3. * has locked (as a natural consequence of the unchecked
  4. * <code>ThreadDeath</code> exception propagating up the stack). If
  5. * any of the objects previously protected by these monitors were in
  6. * an inconsistent state, the damaged objects become visible to
  7. * other threads, potentially resulting in arbitrary behavior. Many
  8. * uses of <code>stop</code> should be replaced by code that simply
  9. * modifies some variable to indicate that the target thread should
  10. * stop running. The target thread should check this variable
  11. * regularly, and return from its run method in an orderly fashion
  12. * if the variable indicates that it is to stop running. If the
  13. * target thread waits for long periods (on a condition variable,
  14. * for example), the <code>interrupt</code> method should be used to
  15. * interrupt the wait.
Add Comment
Please, Sign In to add comment