mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-09 19:06:15 +01:00
gio: Drop redundant g_source_is_destroyed() calls
These calls cause race warnings from tsan, but are not a thread safety problem, because we can only ever observe single bit changes: all modifications to the GSource.flags field are done with a lock held; all reads are of independent fields, so no intermediate state can ever be observed. This assumes that a non-atomic read will consistently give us an old value or a new value. In any case, these g_source_is_destroyed() calls can happen from any thread, and the state could be changed from another thread immediately after the call returns; so the checks are pointless. In addition, calling g_source_set_ready_time() or g_source_destroy() on a destroyed source is not a problem. https://bugzilla.gnome.org/show_bug.cgi?id=778049
This commit is contained in:
parent
553329358c
commit
4091b2d19e
@ -650,8 +650,7 @@ cancellable_source_cancelled (GCancellable *cancellable,
|
||||
{
|
||||
GSource *source = user_data;
|
||||
|
||||
if (!g_source_is_destroyed (source))
|
||||
g_source_set_ready_time (source, 0);
|
||||
g_source_set_ready_time (source, 0);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -1499,8 +1499,7 @@ g_subprocess_communicate_state_free (gpointer data)
|
||||
|
||||
if (state->cancellable_source)
|
||||
{
|
||||
if (!g_source_is_destroyed (state->cancellable_source))
|
||||
g_source_destroy (state->cancellable_source);
|
||||
g_source_destroy (state->cancellable_source);
|
||||
g_source_unref (state->cancellable_source);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user