_EnterMustComplete

VMMCall _EnterMustComplete
 

Increments the must-complete count for the current thread, causing it to enter a must-complete section. Uses the C calling convention. Uses EAX, ECX, EDX, and Flags.

A virtual device can call this service recursively.

For each call to _EnterMustComplete, there must be a corresponding call to _LeaveMustComplete.

This service ensures that the thread is not suspended or killed (via Suspend_VM or Nuke_VM) by another thread while executing a section of critical code. This service is usually used to protect a thread while it owns an important shared resource or state information. If the thread were killed or suspended while it owned such a resource, all other threads would be blocked.

While in a must complete, any suspends or nukes will be postponed until the last _LeaveMustComplete. A must-complete does not change priorities or thread switching in any way.

A VxD can also enter a must complete section automatically by using the MUTEX_MUST_COMPLETE flag with the _CreateMutex service.

See Also

_EnterMutex, _LeaveMustComplete