def read_events

      # can return WAIT_TIMEOUT  = 0x00000102
      dwWaitStatus = Native.WaitForMultipleObjects(@dwChangeHandles.count, 
        @lp_dwChangeHandles, 0, 500)

      events = []

      # this call blocks all threads completely.
      @dwChangeHandles.each_index do |index|
        if dwWaitStatus == WAIT_OBJECT_0 + index

          ev = Event.new(@watchers[@dwChangeHandles[index]])
          events << ev
        
          r = Native.FindNextChangeNotification(@dwChangeHandles[index]) 
          if r == 0 
              raise SystemCallError.new("Failed to watch", r) 
          end
        end
      end
      events
    end
def read_events

      # can return WAIT_TIMEOUT  = 0x00000102
      dwWaitStatus = Native.WaitForMultipleObjects(@dwChangeHandles.count, 
        @lp_dwChangeHandles, 0, 500)

      events = []

      # this call blocks all threads completely.
      @dwChangeHandles.each_index do |index|
        if dwWaitStatus == WAIT_OBJECT_0 + index

          ev = Event.new(@watchers[@dwChangeHandles[index]])
          events << ev
        
          r = Native.FindNextChangeNotification(@dwChangeHandles[index]) 
          if r == 0 
              raise SystemCallError.new("Failed to watch", r) 
          end
        end
      end
      events
    end
Blocks until there are one or more filesystem events
 that this notifier has watchers registered for.
 Once there are events, returns their {Event} objects.

 @private