catching exceptions from another thread

后端 未结 5 1422
名媛妹妹
名媛妹妹 2020-12-13 21:38

I have a method running in a seperate thread. The thread is created and started from a form in a windows application. If an exception is thrown from inside the thread, wha

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-13 21:52

    Throwing exceptions between threads is not easy and probably not desired. instead you can pass the exception using a shared data structure or variable and use waitHandle to wait on the 1st thread.

提交回复
热议问题