[prev in list] [next in list] [prev in thread] [next in thread]
List: gtk-devel
Subject: Re: Is g_source_remove threadsafe?
From: Tim Janik <timj () gtk ! org>
Date: 2007-11-16 13:41:36
Message-ID: Pine.LNX.4.62.0711161438230.7016 () master ! birnet ! private
[Download RAW message or body]
On Fri, 16 Nov 2007, Owen Taylor wrote:
> While I don't really consider
> g_source_remove(some_id_that_I_might_already_have_removed) 100% valid,
> the docs do imply that it is legal, so perhaps it would be worth fixing
> up that case (say, by having a referencing internal variant of
> find_source_by_id().)
i think such a variant really needs to be exposed as public API.
g_main_context_find_source*() is fairly pointless if it can only be used
correctly if the caller must be holding a reference to the returned source
already.
i think this API should have in the first place, either:
- returned an id, because g_source_remove(invalid_id) behaves gracefully, or
- returned a GSource* with increased reference count, to ensure the returned
pointer is alive and valid.
> - Owen
---
ciaoTJ
_______________________________________________
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic