示例#1
0
func (e *event) Wait() error {
	s, err := windows.WaitForSingleObject(e.h, windows.INFINITE)
	switch s {
	case windows.WAIT_OBJECT_0:
		break
	case windows.WAIT_FAILED:
		return err
	default:
		return errors.New("unexpected result from WaitForSingleObject")
	}
	return nil
}
func (e *windowsEvent) Wait(timeout uint32) (uint32, error) {
	return windows.WaitForSingleObject(e.handle, timeout)
}