|
From: Remy B. <rem...@po...> - 2006-06-07 20:17:51
|
I tested your additional patch, and it basically works here on Linux. However: Csaba Henk wrote: > - You don't call pthread_detach(3). According to sshfs and the manpage, > it seems that it should indeed be called after the pthread_create() > call. I disagree with that one. pthread_detach() puts the thread in non-joinable state, and makes it cleanup automatically on exit. However, I call pthread_join() in fuse_stop_idle_monitor_thread() to do the cleanup, and with your patch it fails (you can check its return value, it will always be nonzero). Detaching is necessary in sshfs because it doesn't call pthread_join() when the main loop exits. I prefer the solution using pthread_join(). That way, I am sure that the thread has exited when fuse_stop_idle_monitor_thread() returns. I attached a patch that replaces your second patch, with the following minor fixes: - Removed the call to pthread_detach(). - Don't display mountpoint when trying to unmount. This doesn't really add any value, especially on BSD if the mountpoint is not always present. - Update idle_monitor.last_activity when trying to unmount, as a failed attempt should be considered as activity. -- Remy Remove underscore and suffix in reply address for a timely response. |