Re: Two documentations details (sources IDs, interruptions)
- From: Tristan Van Berkom <tvb gnome org>
- To: Nicolas George <nicolas george ens fr>
- Cc: gtk-list gnome org
- Subject: Re: Two documentations details (sources IDs, interruptions)
- Date: Mon, 29 Aug 2005 14:30:25 -0400
Nicolas George wrote:
[...]
Is it safe to assume that sources IDs returned by g_source_attach or derived
functions are never 0?
As far as I can see in the source, it is safe until a 32-bits integer
overflow. The reason to want to know it is to be able to pack the
information 'I have set up a timeout' along with the source ID necessary
to cancel it.
I always write this type of code:
if (id > 0)
g_source_remove (...);
id = g_timeout_add (...);
But I cant say whether it is common practice, acceptable or
advisable; personally I've made the assumption that its the
way to go :-/
Cheers,
-Tristan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]