#endif /* _SC_THREAD_STACK_MIN */
}
-static void
-g_thread_create_posix_impl (GThreadFunc thread_func,
- gpointer arg,
- gulong stack_size,
- gboolean joinable,
- gboolean bound,
- GThreadPriority priority,
- gpointer thread,
- GError **error)
+void
+g_system_thread_create (GThreadFunc thread_func,
+ gpointer arg,
+ gulong stack_size,
+ gboolean joinable,
+ gboolean bound,
+ GThreadPriority priority,
+ gpointer thread,
+ GError **error)
{
pthread_attr_t attr;
gint ret;
sched_yield ();
}
-static void
-g_thread_join_posix_impl (gpointer thread)
+void
+g_system_thread_join (gpointer thread)
{
gpointer ignore;
posix_check_cmd (pthread_join (*(pthread_t*)thread, &ignore));
pthread_exit (NULL);
}
-static void
-g_thread_self_posix_impl (gpointer thread)
+void
+g_system_thread_self (gpointer thread)
{
*(pthread_t*)thread = pthread_self();
}
g_private_new,
g_private_get,
g_private_set,
- g_thread_create_posix_impl,
+ NULL,
g_thread_yield,
- g_thread_join_posix_impl,
+ NULL,
g_system_thread_exit,
NULL,
- g_thread_self_posix_impl,
+ NULL,
g_system_thread_equal,
};
gboolean joinable;
};
-static void
-g_thread_self_win32_impl (gpointer thread)
+void
+g_system_thread_self (gpointer thread)
{
GThreadData *self = TlsGetValue (g_thread_self_tls);
return 0;
}
-static void
-g_thread_create_win32_impl (GThreadFunc func,
- gpointer data,
- gulong stack_size,
- gboolean joinable,
- gboolean bound,
- GThreadPriority priority,
- gpointer thread,
- GError **error)
+void
+g_system_thread_create (GThreadFunc func,
+ gpointer data,
+ gulong stack_size,
+ gboolean joinable,
+ gboolean bound,
+ GThreadPriority priority,
+ gpointer thread,
+ GError **error)
{
guint ignore;
GThreadData *retval;
Sleep(0);
}
-static void
-g_thread_join_win32_impl (gpointer thread)
+void
+g_system_thread_join (gpointer thread)
{
GThreadData *target = *(GThreadData **)thread;
g_private_new, /* private thread data */
g_private_get,
g_private_set,
- g_thread_create_win32_impl, /* thread */
+ NULL, /* thread */
g_thread_yield,
- g_thread_join_win32_impl,
+ NULL,
g_system_thread_exit,
NULL,
- g_thread_self_win32_impl,
+ NULL,
g_system_thread_equal
};
g_threads_got_initialized = TRUE;
g_private_init (&g_thread_specific_private, g_thread_cleanup);
g_private_set (&g_thread_specific_private, main_thread);
- G_THREAD_UF (thread_self, (&main_thread->system_thread));
+ g_system_thread_self (&main_thread->system_thread);
/* accomplish log system initialization to enable messaging */
_g_messages_thread_init_nomessage ();
if (!g_thread_supported ())
return;
- G_THREAD_UF (thread_self, (&self));
+ g_system_thread_self (&self);
if (g_system_thread_equal (&self, &mutex->owner))
{
if (!g_thread_supported ())
return TRUE;
- G_THREAD_UF (thread_self, (&self));
+ g_system_thread_self (&self);
if (g_system_thread_equal (&self, &mutex->owner))
{
if (depth == 0)
return;
- G_THREAD_UF (thread_self, (&self));
+ g_system_thread_self (&self);
if (g_system_thread_equal (&self, &mutex->owner))
{
result->thread.data = data;
result->private_data = NULL;
G_LOCK (g_thread);
- G_THREAD_UF (thread_create, (g_thread_create_proxy, result,
- stack_size, joinable, bound, 0,
- &result->system_thread, &local_error));
+ g_system_thread_create (g_thread_create_proxy, result,
+ stack_size, joinable, bound, 0,
+ &result->system_thread, &local_error);
if (!local_error)
{
result->next = g_thread_all_threads;
g_return_val_if_fail (thread->joinable, NULL);
g_return_val_if_fail (!g_system_thread_equal (&real->system_thread, &zero_thread), NULL);
- G_THREAD_UF (thread_join, (&real->system_thread));
+ g_system_thread_join (&real->system_thread);
retval = real->retval;
thread->thread.data = NULL;
thread->private_data = NULL;
- G_THREAD_UF (thread_self, (&thread->system_thread));
+ g_system_thread_self (&thread->system_thread);
g_private_set (&g_thread_specific_private, thread);
(memcpy (&(dest), &(src), GLIB_SIZEOF_SYSTEM_THREAD))
#endif /* GLIB_SIZEOF_SYSTEM_THREAD == SIZEOF_VOID_P */
+G_GNUC_INTERNAL void g_system_thread_self (gpointer thread);
+G_GNUC_INTERNAL void g_system_thread_join (gpointer thread);
+G_GNUC_INTERNAL void g_system_thread_create (GThreadFunc func,
+ gpointer data,
+ gulong stack_size,
+ gboolean joinable,
+ gboolean bound,
+ GThreadPriority priority,
+ gpointer thread,
+ GError **error);
G_GNUC_INTERNAL gboolean g_system_thread_equal (gpointer thread1,
gpointer thread2);