BOOST: recursive shared_mutex?

后端 未结 5 2054
傲寒
傲寒 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条回答
  •  -上瘾入骨i
    2021-02-13 05:04

    boost::recursive mutex is exclusive. I think you will need to extend shared_mutex. You can keep current thread ID in a set and check if it exist in the set in function providing lock.

提交回复
热议问题