Re: Pushing a NULL into g_async_queue



Alan M. Evans wrote:

Hello all.

Is there some good reason for the prohibition on passing NULL data into
g_async_queue_push()? I checked the glib sources and the only reason I
could find is that data==NULL won't pass the g_return_if_fail(data)
test. What is the reason for this seemingly arbitrary limitation?
This question is probably better suited to gtk-list or gtk-app-devel-list -- gtk-devel-list is for discussion of development of GTK.

In answer to your question, consider the g_async_queue_try_pop() and g_async_queue_timed_pop() functions. They will either return a value from the queue, or NULL if no items exist. If you can store NULLs in the queue, then the result becomes ambiguous.

James.



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