mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 06:33:41 +02:00
thread: simplify 'free' process
GThread is freed using some very slightly confusing logic: if the thread was created 'joinable', then the structure is freed after the join() call succeeds (since we know the thread has exited). If the thread was not created 'joinable' then the free is when the thread quits (since we know 'join' will not be called later). Move to a straight ref-counting system: 1 ref owned by the thread and 1 extra ref if the thread is joinable. Both thread quit and joining will decrease the refcount by 1.
This commit is contained in:
@@ -59,6 +59,7 @@ struct _GRealThread
|
||||
{
|
||||
GThread thread;
|
||||
|
||||
gint ref_count;
|
||||
gboolean ours;
|
||||
const gchar *name;
|
||||
gpointer retval;
|
||||
|
Reference in New Issue
Block a user