force exit from readline() function

前端 未结 4 1050
遥遥无期
遥遥无期 2020-12-21 10:47

I am writing program in c++ which runs GNU readline in separate thread. When main thread is exited I need to finish the thread in which readline() function is called. The re

4条回答
  •  天命终不由人
    2020-12-21 11:03

    C++ standard input is not designed to be thread safe. So, even if there was a method to programatically stop it from waiting input, you wouldn't be able to call it from another thread. Of course, there could be an implementation specific way to do so.

提交回复
热议问题