- name
SKILL.md
技能檔案保留在發布者的儲存庫中。
在終端機中貼上複製的指令。它會將這個 SKILL.md 安裝到對應的代理中。
npx skills add microsoft/win-dev-skills --skill windbg-user-mutex-held-across-co-await -a cursor -y在終端機中貼上複製的指令。它會將這個 SKILL.md 安裝到對應的代理中。
npx skills add microsoft/win-dev-skills --skill windbg-user-mutex-held-across-co-await -a claude-code -y在終端機中貼上複製的指令。它會將這個 SKILL.md 安裝到對應的代理中。
npx skills add microsoft/win-dev-skills --skill windbg-user-mutex-held-across-co-await -a codex -y在終端機中貼上複製的指令。它會將這個 SKILL.md 安裝到對應的代理中。
npx skills add microsoft/win-dev-skills --skill windbg-user-mutex-held-across-co-await -a grok -y在 Grok Bot 聊天中傳送複製的訊息。Bot 會從 GitHub 取得這個 SKILL.md,並加入你所有 Bot 共用的技能中。
Install this skill: https://github.com/microsoft/win-dev-skills/tree/HEAD/plugins/windbg/skills/windbg-user-mutex-held-across-co-await來自發布者
Load windbg-diagnostic-method first if it is not already loaded in this
conversation, and apply it throughout for evidence ranking, hypothesis testing,
confidence calibration, independent review, and report validation. This skill
adds the bug-family-specific commands and evidence requirements.
This pattern can occur in native application, service, or user-mode driver
code, including UMDF components that use C++ coroutines. Look for a lock
acquired before co_await and released after resumption or
coroutine destruction. Mutex ownership belongs to the acquiring thread, not
the coroutine frame. A resumption on another thread can violate that contract.
Even same-thread resumption can create reentrancy or progress problems when
the awaited operation needs a lock the coroutine still holds.
resume_background intentionally switches.
Do not assume every WinRT awaitable always resumes on a worker or always on
the originating thread.If the symptom is general blocking use windbg-user-wait-chain-analysis. For damaged
heap objects use windbg-user-heap-corruption-investigation. If a recording is available,
windbg-user-ttd-reverse-debugging-triage can help establish the ownership timeline.
Conceptual sequence, not a promise about any particular scheduler:
under lock:
take a snapshot and its generation
release lock
await work using that snapshot
under lock on the resumed thread:
revalidate generation, lifetime, and assumptions
apply result or explicitly handle a stale/cancelled operation
release lock
Use RAII for each synchronous scope. If invariants cannot tolerate unlocking,
redesign the operation or use a specifically designed asynchronous coordination
primitive with cancellation/lifetime rules. Switching to a recursive mutex or
shared_mutex does not make a thread-affine lock coroutine-safe.
Do not recommend a blanket mutex-type replacement. Shared locking is a separate design decision; changing the primitive does not repair suspension ownership. Keep the object and any captured interfaces alive across asynchronous work.
Follow FEEDBACK.md and report reviewed, sanitized feedback to
WinDbg-Feedback.
Include windbg-user-mutex-held-across-co-await and the package version from plugin.json;
no automatic source, dump, or transcript upload.
Use when app, service, or user-mode driver C++ coroutine code holds a thread-affine lock across suspension and later hangs or fails. Not for all coroutine crashes or choosing lock performance.
---name: windbg-user-mutex-held-across-co-awaitdescription: Use when app, service, or user-mode driver C++ coroutine code holds a thread-affine lock across suspension and…---# plugins/windbg/skills/windbg-user-mutex-held-across-co-await/SKILL.md常見問題
從發布者下載 plugins/windbg/skills/windbg-user-mutex-held-across-co-await/SKILL.md,或複製路徑後開啟儲存庫。PlugMCP 只收錄這項技能,不代管檔案。
發布者將它存放在 https://github.com/microsoft/win-dev-skills。
Claude、Cursor、Codex 和 Grok Build 可以讀取你從發布者儲存庫加入的 SKILL.md。在聊天中傳送技能的 GitHub 資料夾連結,Grok Bot 就會安裝它。