Created attachment 6779
Handle folder change events with file info synchronization
Here's the latest set of changes that I have been testing which handle folder change events and synchronize updates to file info by multiple threads.
The patch contains the following changes to address the problems:
1. The file monitor no longer watches for move / rename events. (Harald's patch)
thunar_file_monitor no longer handles G_FILE_MONITOR_EVENT_MOVED.
thunar_file_monitor_moved has been renamed to thunar_file_renamed which is only called by thunar_file_rename.
2. The folder monitor now watches for move events using the newer G_FILE_MONITOR_WATCH_MOVES flag.
thunar_file_monitor no longer handles G_FILE_MONITOR_EVENT_MOVED.
thunar_file_monitor now handles G_FILE_MONITOR_EVENT_CREATED, G_FILE_MONITOR_EVENT_MOVED_IN, G_FILE_MONITOR_EVENT_DELETED, G_FILE_MONITOR_EVENT_MOVED_OUT and G_FILE_MONITOR_EVENT_RENAMED events.
3. Added thread synchronization around critical sections clearing and reloading file info by introducing locking on file_info_mutex in thunar_file_get_async_finish, thunar_file_load and thunar_file_get_with_info.
Created attachment 6779
Handle folder change events with file info synchronization
Here's the latest set of changes that I have been testing which handle folder change events and synchronize updates to file info by multiple threads.
The patch contains the following changes to address the problems:
1. The file monitor no longer watches for move / rename events. (Harald's patch) MONITOR_ EVENT_MOVED. file_monitor_ moved has been renamed to thunar_file_renamed which is only called by thunar_file_rename.
thunar_file_monitor no longer handles G_FILE_
thunar_
2. The folder monitor now watches for move events using the newer G_FILE_ MONITOR_ WATCH_MOVES flag. MONITOR_ EVENT_MOVED. MONITOR_ EVENT_CREATED, G_FILE_ MONITOR_ EVENT_MOVED_ IN, G_FILE_ MONITOR_ EVENT_DELETED, G_FILE_ MONITOR_ EVENT_MOVED_ OUT and G_FILE_ MONITOR_ EVENT_RENAMED events.
thunar_file_monitor no longer handles G_FILE_
thunar_file_monitor now handles G_FILE_
3. Added thread synchronization around critical sections clearing and reloading file info by introducing locking on file_info_mutex in thunar_ file_get_ async_finish, thunar_file_load and thunar_ file_get_ with_info.