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.
Wait_Semaphore
                                                     Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
include vmm.inc
 
mov     eax, Semaphore      ; semaphore handle
mov     ecx, Flags          ; flags for servicing interrupts
VMMcall Wait_Semaphore
 
The Wait_Semaphore service blocks the current virtual machine until the
semaphore is signaled using the Signal_Semaphore service.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
Semaphore  Specifies a handle identifying the semaphore on which to wait.
 
Flags      Specifies actions to take when interrupts occur while the virtual
           machine is blocked waiting for the semaphore. 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.
 
           Block_Poll                Do not switch away from the blocked
                                     virtual machine unless another virtual
                                     machine has higher priority.
 
Return Value
 
This service has no return value.
 
Comments
 
This service blocks if the semaphore's unblock count is zero and the token
count is zero or less. Otherwise, it decrements the token count and returns
immediately. If the unblock count is not zero (meaning the Signal_Semaphore
service has been called), Wait_Semaphore decrements the unblock count and
returns immediately.
 
Uses
 
Flags
 
See Also
 
Create_Semaphore, Signal_Semaphore