A Safe Way to Stop a Java Thread - DevX: Your Information Source for Enterprise Application Devel

A Safe Way to Stop a Java Thread - DevX: Your Information Source for Enterprise Application Devel

瀏覽:1168
日期:2025-06-10
The Thread.stop() method is unsafe and thus deprecated. If the thread being stopped was modifying common data, that common data remains in an inconsistent state. A better way would be to have a variable indicating if the thread should be stopped. Other th...看更多