In this chapter, we will talk about properly closing a thread. The built-in method Thread.stop() is deprecated and we should implement our own method for closing a thread properly.
It is really important that we properly close a thread, especially if the thread does work on things that can lead to data loss, data inconsistency etc. In this chapter, we will look into a method where we make use of a flag to properly stop a thread if needed.
You can find the source code of this chapter in the following GitHub repository.
https://github.com/afsalashyana/Java-...
Website:-
https://www.genuinecoder.com
#Multithreading
#GenuineCoder
#Java
Watch video Java Multithreading Tutorial for Beginners #7: How to safely stop a thread ? online without registration, duration hours minute second in high quality. This video was added by user Genuine Coder 02 March 2019, don't forget to share it with your friends and acquaintances, it has been viewed on our site 7,73 once and liked it 11 people.