Exceptions in multithreaded application.

前端 未结 10 1523
春和景丽
春和景丽 2021-02-15 00:02

I have heard from a very discerning person that an exception being thrown (and not caught) in a thread is being propagated to the parent thread. Is that true? I have tried some

10条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-15 00:16

    An exception can only be caught on the thread from which is came. So throwing an exception on another thread won't cause another thread to catch it.

    There is no concept of a "parent" thread.

提交回复
热议问题