mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-24 19:10:24 +00:00
Fix race when fs events occur right after constructing worktree
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
110dcc48f9
commit
907b537a0b
1 changed files with 6 additions and 1 deletions
|
@ -74,7 +74,7 @@ impl EventStream {
|
|||
Self::trampoline,
|
||||
&stream_context,
|
||||
cf_paths,
|
||||
fs::kFSEventStreamEventIdSinceNow,
|
||||
FSEventsGetCurrentEventId(),
|
||||
latency.as_secs_f64(),
|
||||
fs::kFSEventStreamCreateFlagFileEvents
|
||||
| fs::kFSEventStreamCreateFlagNoDefer
|
||||
|
@ -285,6 +285,11 @@ impl std::fmt::Display for StreamFlags {
|
|||
}
|
||||
}
|
||||
|
||||
#[link(name = "CoreServices", kind = "framework")]
|
||||
extern "C" {
|
||||
pub fn FSEventsGetCurrentEventId() -> u64;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_event_stream() {
|
||||
use std::{fs, sync::mpsc, time::Duration};
|
||||
|
|
Loading…
Reference in a new issue