First, stop
The Stop method is not recommended, and the official word is "an unpredictable problem may occur." In fact, the thread stops itself after calling the Stop method. When the thread stops, it stops executing and frees the lock resource that it is using. The problem here is that if a thread takes a lock, takes only a few steps, and has a few steps left to execute, if the lock is released at this time, the other thread takes over again, which can cause the thread to be unsafe. And the problem is almost impossible to debug.
Ii. Suspend and Resume methods
These two methods must appear in pairs, otherwise it is very easy to deadlock because the Suspend method does not release the lock. If there is no guarantee that someone will call the Resume method later, it will cause the thread to hang forever. Second, the suspend and resume methods are usually not necessarily a thread in order to execute. It is possible that one thread suspend another thread to resume, and if it does not handle the order of calls between threads, it is very likely that the resume occurs before suspend, which in turn causes the thread to suspend, and no one will ever resume him, "thread freezes "The scene.
Why Java threads do not recommend calling the Stop,suspend,resume method