Re: GLib source id wrap around



On Thu, 2003-10-09 at 20:51, Max Krasnyansky wrote:
> I'd say we need to add something like following to that function.
>         /* Handle wrap around. id 0 is invalid */
>         if (!context->next_id)
>                 context->next_id = 1;

That doesn't do any good, because it doesn't keep you from colliding
with existing source IDs. To make wraparound work you would need to keep
track of all outstanding IDs and pick the next unused one.
The current assumption is simply that wraparound won't happen.

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]