mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 04:24:47 +00:00
server: Fix a race condition in the delivery of change notifications.
This commit is contained in:
parent
c44410d1e3
commit
f5c1381e06
|
@ -591,11 +591,6 @@ static void inotify_do_change_notify( struct dir *dir, unsigned int action,
|
||||||
|
|
||||||
if (!list_empty( &dir->change_q ))
|
if (!list_empty( &dir->change_q ))
|
||||||
async_terminate_head( &dir->change_q, STATUS_ALERTED );
|
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 )
|
static unsigned int filter_from_event( struct inotify_event *ie )
|
||||||
|
@ -1133,6 +1128,11 @@ DECL_HANDLER(read_directory_changes)
|
||||||
if (event)
|
if (event)
|
||||||
reset_event( 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 */
|
/* setup the real notification */
|
||||||
if (!inotify_adjust_changes( dir ))
|
if (!inotify_adjust_changes( dir ))
|
||||||
dnotify_adjust_changes( dir );
|
dnotify_adjust_changes( dir );
|
||||||
|
|
Loading…
Reference in a new issue