mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
glocalfilemonitor: Fix data race in local file monitor
Ensure that source is attached to the context before it migth be used from another thread, since otherwise operation on source are unsynchronized and not thread-safe. In particular there was a data race between g_source_attach and g_source_set_ready_time (used from g_file_monitor_source_handle_event).
This commit is contained in:
parent
c4cb27d844
commit
6336864171
@ -788,11 +788,11 @@ g_local_file_monitor_start (GLocalFileMonitor *local_monitor,
|
||||
#endif
|
||||
}
|
||||
|
||||
g_source_attach ((GSource *) source, context);
|
||||
|
||||
G_LOCAL_FILE_MONITOR_GET_CLASS (local_monitor)->start (local_monitor,
|
||||
source->dirname, source->basename, source->filename,
|
||||
source);
|
||||
|
||||
g_source_attach ((GSource *) source, context);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user