Is the mutex implemented inside ID3D11Multithread reentrant? Reentrancy means that the thread which holds the mutex can lock it again without unlocking in between.
CodePudding user response:
Yes. I tested by calling Enter() twice in a row, and the second call succeeds immediately.
CodePudding user response:
If it is not documented then it is a bit risky to assume it is safe even though it does seem to work.
What tips the scale in your favor is that MSDN describes the interface as "Provides threading protection for critical sections of a multi-threaded application" and EnterCriticalSection
is a basic locking function that is documented to support multiple calls from the same thread.
The Wine implementation calls wined3d_mutex_lock
which also ends up calling EnterCriticalSection
.