wheybags
wheybags

Reputation: 657

Is ID3D11Multithread::Enter reentrant?

Is the mutex implemented inside ID3D11Multithread reentrant? Reentrancy means that the thread which holds the mutex can lock it again without unlocking in between.

Upvotes: 0

Views: 153

Answers (2)

Anders
Anders

Reputation: 101764

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.

Upvotes: 1

wheybags
wheybags

Reputation: 657

Yes. I tested by calling Enter() twice in a row, and the second call succeeds immediately.

Upvotes: 0

Related Questions