Skip to content

gthreadpool: Clarify that item_free_func is not normally called

Philip Withnall requested to merge pwithnall/glib:thread-pool-docs-fix into main

If you’re only quickly looking at the API signature, it looks like item_free_func will be called for all items enqueued to the thread pool.

As it happens, it’s actually only called for the items which are still enqueued when the thread pool is destroyed. The user’s GFunc is responsible for freeing items which are successfully dequeued and processed during the lifetime of the thread pool.

That’s a bit of a gotcha, so document it more explicitly.

Signed-off-by: Philip Withnall pwithnall@endlessos.org

Merge request reports