mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-26 03:59:55 +00:00
Flush the fs event stream on construction
This commit is contained in:
parent
c1d35b099b
commit
1eba61c08d
1 changed files with 15 additions and 9 deletions
|
@ -82,6 +82,15 @@ impl EventStream {
|
||||||
);
|
);
|
||||||
cf::CFRelease(cf_paths);
|
cf::CFRelease(cf_paths);
|
||||||
|
|
||||||
|
fs::FSEventStreamScheduleWithRunLoop(
|
||||||
|
stream,
|
||||||
|
cf::CFRunLoopGetCurrent(),
|
||||||
|
cf::kCFRunLoopDefaultMode,
|
||||||
|
);
|
||||||
|
fs::FSEventStreamStart(stream);
|
||||||
|
fs::FSEventStreamFlushSync(stream);
|
||||||
|
fs::FSEventStreamStop(stream);
|
||||||
|
|
||||||
let state = Arc::new(Mutex::new(Lifecycle::New));
|
let state = Arc::new(Mutex::new(Lifecycle::New));
|
||||||
|
|
||||||
(
|
(
|
||||||
|
@ -111,12 +120,8 @@ impl EventStream {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fs::FSEventStreamScheduleWithRunLoop(self.stream, run_loop, cf::kCFRunLoopDefaultMode);
|
fs::FSEventStreamScheduleWithRunLoop(self.stream, run_loop, cf::kCFRunLoopDefaultMode);
|
||||||
|
|
||||||
fs::FSEventStreamStart(self.stream);
|
fs::FSEventStreamStart(self.stream);
|
||||||
cf::CFRunLoopRun();
|
cf::CFRunLoopRun();
|
||||||
|
|
||||||
fs::FSEventStreamFlushSync(self.stream);
|
|
||||||
fs::FSEventStreamStop(self.stream);
|
|
||||||
fs::FSEventStreamRelease(self.stream);
|
fs::FSEventStreamRelease(self.stream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -133,11 +138,12 @@ impl EventStream {
|
||||||
let event_paths = event_paths as *const *const ::std::os::raw::c_char;
|
let event_paths = event_paths as *const *const ::std::os::raw::c_char;
|
||||||
let e_ptr = event_flags as *mut u32;
|
let e_ptr = event_flags as *mut u32;
|
||||||
let i_ptr = event_ids as *mut u64;
|
let i_ptr = event_ids as *mut u64;
|
||||||
let callback = (info as *mut Option<RunCallback>)
|
let callback_ptr = (info as *mut Option<RunCallback>).as_mut().unwrap();
|
||||||
.as_mut()
|
let callback = if let Some(callback) = callback_ptr.as_mut() {
|
||||||
.unwrap()
|
callback
|
||||||
.as_mut()
|
} else {
|
||||||
.unwrap();
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
let paths = slice::from_raw_parts(event_paths, num);
|
let paths = slice::from_raw_parts(event_paths, num);
|
||||||
let flags = slice::from_raw_parts_mut(e_ptr, num);
|
let flags = slice::from_raw_parts_mut(e_ptr, num);
|
||||||
|
|
Loading…
Reference in a new issue