how to restart a thread

前端 未结 5 1583
梦毁少年i
梦毁少年i 2021-01-21 22:58

I tried to write a file monitor which will check the file if a new line is appended,the monitor in fact is a thread which will read the line by a randomaccessfile all the time.

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-21 23:30

    I assume you answered your question

    one can not restart a dead thread

    This link may be helpful to you How to restart thread in java?

提交回复
热议问题