Virtual Devices (3.1) (vdag31qh.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Begin_Critical_Section
                                                     Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
include vmm.inc
 
mov     ecx, Flags              ; flags for servicing interrupts
VMMcall Begin_Critical_Section
 
The Begin_Critical_Section service causes the current virtual machine to
enter a critical section. Only one virtual machine can own the critical
section at a time. If a virtual machine calls this service while another
virtual machine owns the critical section, the calling virtual machine will
block until the critical section is released.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
Flags      Specifies actions to take when interrupts occur while the virtual
           machine is blocked waiting for the critical section. This
           parameter can be a combination of the following values:
 
           Value                     Meaning
           ─────────────────────────────────────────────────────────────────
           Block_Svc_Ints            Service interrupts in the virtual
                                     machine even if the virtual machine is
                                     blocked.
 
           Block_Svc_If_Ints_Locked  Service interrupts in the virtual
                                     machine even if the virtual machine is
                                     blocked and the VMStat_V86IntsLocked
                                     flag is set.
 
           Block_Enable_Ints         Service interrupts in the virtual
                                     machine even if the virtual machine
                                     does not currently have interrupts
                                     enabled. This forces interrupts to be
                                     enabled. This value is only relevant if
                                     either Block_Svc_Ints or
                                     Block_Svc_If_Ints_Locked is set.
 
           The Block_Poll value is reserved and must not be used with this
           service.
 
Return Value
 
This service has no return value.
 
Comments
 
The system maintains a count of claims for critical sections and releases
the critical section only when an equal number of Begin_Critical_Section
End_Critical_Section services have been called.
 
When the critical section is first claimed, the system boosts the execution
priority of the current virtual machine by the Critical_Section_Boost value
(as described for the Adjust_Exec_Priority service). While a virtual machine
is in a critical section, the system will switch to another task only if the
virtual machine blocks on a semaphore or the other task has a time-critical
operation, such as simulating hardware interrupts.
 
Uses
 
Flags
 
See Also
 
Adjust_Exec_Priority, End_Critical_Section