diff options
Diffstat (limited to 'winsup/cygwin/ntdll.h')
-rw-r--r-- | winsup/cygwin/ntdll.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/winsup/cygwin/ntdll.h b/winsup/cygwin/ntdll.h index e9ff11bf0..b420f02d5 100644 --- a/winsup/cygwin/ntdll.h +++ b/winsup/cygwin/ntdll.h @@ -1292,6 +1292,18 @@ extern "C" fbi.FileAttributes = attr ?: FILE_ATTRIBUTE_NORMAL; return NtSetInformationFile(h, &io, &fbi, sizeof fbi, FileBasicInformation); } + + /* This test for a signalled event is twice as fast as calling + WaitForSingleObject (event, 0). */ + inline + BOOL NTAPI IsEventSignalled (HANDLE event) + { + EVENT_BASIC_INFORMATION ebi; + return NT_SUCCESS (NtQueryEvent (event, EventBasicInformation, + &ebi, sizeof ebi, NULL)) + && ebi.SignalState != 0; + + } } #endif #endif /*_NTDLL_H*/ |