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

前端 未结 4 1380
执笔经年
执笔经年 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:14

    boost is simply calling a callback from its perspective. This callback has no relation to boost, so boost doesn't care what you do in the callback. So taking a lock (using any locking library you desire), is perfectly fine.

提交回复
热议问题