Example #1
0
// Stop listening to the event stream.
func (es *EventStream) Stop() {
	if es.stream != nil {
		C.FSEventStreamStop(es.stream)
		C.FSEventStreamInvalidate(es.stream)
		C.FSEventStreamRelease(es.stream)
		C.CFRunLoopStop(es.rlref)
	}
	es.stream = nil
}
Example #2
0
// Stop stops underlying FSEventStream and unregisters it from global runloop.
func (s *stream) Stop() {
	if s.ref == nilstream {
		return
	}
	wg.Wait()
	C.FSEventStreamStop(s.ref)
	C.FSEventStreamInvalidate(s.ref)
	C.CFRunLoopWakeUp(runloop)
	s.ref = nilstream
}
Example #3
0
// Stop listening to the event stream.
func (es *EventStream) Stop() {
	if es.stream != nil {
		C.FSEventStreamStop(es.stream)
		C.FSEventStreamInvalidate(es.stream)
		C.FSEventStreamRelease(es.stream)
		C.CFRunLoopStop(es.rlref)
		registry.Delete(es.registryID)
	}
	es.stream = nil
	es.registryID = 0
}
Example #4
0
func (w *Watcher) removeWatch(path string) error {
	w.wmut.Lock()
	stream, found := w.watches[path]
	w.wmut.Unlock()

	if found {
		C.FSEventStreamStop(stream)
		C.FSEventStreamInvalidate(stream)
		C.FSEventStreamRelease(stream)
		w.wmut.Lock()
		delete(w.watches, path)
		w.wmut.Unlock()
	}

	return nil
}
Example #5
0
// https://developer.apple.com/library/mac/documentation/Darwin/Reference/FSEvents_Ref/Reference/reference.html#jumpTo_21
func (s Stream) stop() {
	C.FSEventStreamStop(s.cstream)
}