BOOST: recursive shared_mutex?

后端 未结 5 1971
傲寒
傲寒 2021-02-13 04:16

Seems that Boost\'s shared_mutex is non recursive.. Is there anyway around this? (without re implementing the whole stuff)

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-13 05:03

    I've been down this road personally before. The simple answer is no, there is no shared_recursive_mutex.

    I don't really agree with what others will tell you about how recursive mutexes are generally a bad idea, it certainly can save some time and prevent some errors. However, if you don't want to implement your own shared_recursive_mutex, you'll have to stick with non-recursive mutexes. It's not so bad.

提交回复
热议问题