Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

An application hangs when it calls SignalObjectAndWait in Windows 7 or Windows Server 2008 R2


View products that this article applies to.

Symptoms

An application that calls the SignalObjectAndWait and PulseEvent APIs may experience a deadlock in Windows 7 or in Windows Server 2008 R2. If the threads that are signalled by SignalObjectAndWait call PulseEvent to signal the waiting object of the SignalObjectAndWait call, the caller thread of SignalObjectAndWait cannot receive the signal state of the waiting object.

↑ Back to the top


Cause

The Signal and Wait operations are not guaranteed to be performed as atomic operations when an application calls the SignalObjectAndWait function.

↑ Back to the top


Resolution

To resolve this problem, configure the application to call the SetEvent API instead of the PulseEvent API. This method should work in most cases.

↑ Back to the top


Keywords: kb

↑ Back to the top

Article Info
Article ID : 2795543
Revision : 1
Created on : 1/7/2017
Published on : 1/30/2013
Exists online : False
Views : 213