感谢@PeterT的评论,为各种互斥类型编写了一个可视化工具(放置在/Documents/Visual Studio 2017/Visualizers/mutex.natvis):
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="std::_Mutex_base">
<Expand>
<Item Name="[thread_id]">*(long*)((char*)&_Mtx_storage+sizeof(_Mtx_storage)-8)</Item>
<Item Name="[count]">*(int*)((char*)&_Mtx_storage+sizeof(_Mtx_storage)-4)</Item>
</Expand>
</Type>
<Type Name="std::mutex">
<DisplayString>mutex</DisplayString>
<Expand>
<ExpandedItem>(_Mutex_base*)this</ExpandedItem>
</Expand>
</Type>
<Type Name="std::timed_mutex">
<DisplayString>timed_mutex</DisplayString>
<Expand>
<Item Name="[locked]">_My_locked</Item>
</Expand>
</Type>
<Type Name="std::recursive_mutex">
<DisplayString>recursive_mutex</DisplayString>
<Expand>
<ExpandedItem>(_Mutex_base*)this</ExpandedItem>
</Expand>
</Type>
<Type Name="std::recursive_timed_mutex">
<DisplayString>recursive_timed_mutex</DisplayString>
<Expand>
<Item Name="[locked]">_My_locked</Item>
<Item Name="[owner]">_My_owner</Item>
</Expand>
</Type>
</AutoVisualizer>
_Mtx_internal_imp_t*
。 - PeterT\crt\src\stl\mutex.c
中看到。 - PeterT