Use std::mutex for a thread pool managed by boost::asio

前端 未结 4 1378
执笔经年
执笔经年 2021-01-03 08:36

Somehow a followup of this question. I am only wondering if it is ok to use a std::mutex in functions handeled by a boost::asio:io_service? Usage o

4条回答
  •  时光说笑
    2021-01-03 09:05

    Yes, using a std::mutex inside of a handler is perfectly fine. A strand is just a queue with a mutex in disguise after all.

提交回复
热议问题