In this chapter, we will talk about checking whether a thread is alive at a point and about waiting for a thread to finish.
Java Thread API provides option to check whether a thread is running or not using the method ThreadObject.isAlive().
Join is used to wait a thread to finish. The join() method waits for a thread to die. It causes the currently running threads to stop executing until the thread it joins with completes its task. Join also provides a overridden method with wait time which when provided will wait for a maximum of given time for the thread to die.
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
Смотрите видео Java Multithreading Tutorial for Beginners #6: Thread Status and Join онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Genuine Coder 23 Февраль 2019, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 4,292 раз и оно понравилось 75 людям.