It appears that the destroy and release handlers in libfuse may not be thread-safe, or at least there's no clear guarantee in the documentation that they are called only after all related operations (like read) have completed.
For example, consider a multithreaded FUSE loop: if one thread is handling a read request and is blocked waiting for some resource, another thread could potentially receive a release request for the same file descriptor in parallel. The documentation does not clarify whether such overlap is prevented or whether the user is responsible for handling such race conditions.
Could you clarify whether the FUSE library ensures serialization of such operations on the same file descriptor, or should users implement their own synchronization for this?