How to wait for the mountpoint to be ready ?
How should I wait for the mountpoint to be ready ?
When I create a mountpoint using Session::spawn, I consider it to be ready once the Filesystem::init method is called.
To wait for that event, I'm using a Mutex<bool> and a Condvar to signal the event and set them at the end of the init method.
This work well enough on Linux, but on macOS I suspect this is causing some of my tests to be flaky because the mountpoint is not ready at that point.
Currently I don't see any other way to wait for the mountpoint to be ready, maybe It's something that could be added to Session/BackgroundSession.
See https://github.com/zargony/fuse-rs/issues/9#issuecomment-32167809 And possibly https://github.com/libfuse/libfuse/discussions/1100 also.
In my experience, the Kernel always calls getattr on inode 1 before it does anything else. Maybe that should be your signal that the Kernel is ready?