#define posix_check_cmd(cmd) posix_check_err (cmd, #cmd)
+GRealThread *
+g_system_thread_new (void)
+{
+ return g_slice_new0 (GRealThread);
+}
+
+void
+g_system_thread_free (GRealThread *thread)
+{
+ g_slice_free (GRealThread, thread);
+}
+
void
g_system_thread_create (GThreadFunc thread_func,
gpointer arg,
gboolean joinable;
};
+GRealThread *
+g_system_thread_new (void)
+{
+ return g_slice_new0 (GRealThread);
+}
+
+void
+g_system_thread_free (GRealThread *thread)
+{
+ g_slice_free (GRealThread, thread);
+}
+
void
g_system_thread_exit (void)
{
* If it is, the structure is freed in g_thread_join()
*/
if (!thread->thread.joinable)
- g_free (thread);
+ g_system_thread_free (thread);
}
}
g_return_val_if_fail (func != NULL, NULL);
- result = g_new0 (GRealThread, 1);
+ result = g_system_thread_new ();
result->thread.joinable = joinable;
result->thread.func = func;
if (local_error)
{
g_propagate_error (error, local_error);
- g_free (result);
+ g_system_thread_free (result);
return NULL;
}
* thread end. We free the memory here. This will leave a loose end,
* if a joinable thread is not joined.
*/
- g_free (thread);
+ g_system_thread_free (real);
return retval;
}
typedef struct _GRealThread GRealThread;
G_GNUC_INTERNAL void g_system_thread_join (gpointer thread);
+
+G_GNUC_INTERNAL
+GRealThread * g_system_thread_new (void);
G_GNUC_INTERNAL void g_system_thread_create (GThreadFunc func,
gpointer data,
gulong stack_size,
gboolean joinable,
gpointer thread,
GError **error);
+G_GNUC_INTERNAL
+void g_system_thread_free (GRealThread *thread);
G_GNUC_INTERNAL void g_system_thread_exit (void);
G_GNUC_INTERNAL void g_system_thread_set_name (const gchar *name);