Mike McCormack : server: Fix a race condition in the delivery of change notifications.
Module: wine Branch: refs/heads/master Commit: f5c1381e065bfab1903eebd7596f670b82c28509 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=f5c1381e065bfab1903eebd7... Author: Mike McCormack <mike(a)codeweavers.com> Date: Tue Mar 28 17:58:07 2006 +0900 server: Fix a race condition in the delivery of change notifications. --- server/change.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/change.c b/server/change.c index 4349d7e..eec1241 100644 --- a/server/change.c +++ b/server/change.c @@ -591,11 +591,6 @@ static void inotify_do_change_notify( st if (!list_empty( &dir->change_q )) async_terminate_head( &dir->change_q, STATUS_ALERTED ); - else - { - dir->signaled++; - dir_signal_changed( dir ); - } } static unsigned int filter_from_event( struct inotify_event *ie ) @@ -1133,6 +1128,11 @@ DECL_HANDLER(read_directory_changes) if (event) reset_event( event ); + /* if there's already a change in the queue, send it */ + if (!list_empty( &dir->change_q ) && + !list_empty( &dir->change_records )) + async_terminate_head( &dir->change_q, STATUS_ALERTED ); + /* setup the real notification */ if (!inotify_adjust_changes( dir )) dnotify_adjust_changes( dir );
participants (1)
-
Alexandre Julliard