mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-24 19:22:11 +01:00
Don't use the thread_exit vfunc
Instead, just have the backends implement an internal function named g_system_thread_exit.
This commit is contained in:
parent
cc7631cd19
commit
a10306060c
@ -651,8 +651,8 @@ g_thread_join_posix_impl (gpointer thread)
|
||||
posix_check_cmd (pthread_join (*(pthread_t*)thread, &ignore));
|
||||
}
|
||||
|
||||
static void
|
||||
g_thread_exit_posix_impl (void)
|
||||
void
|
||||
g_system_thread_exit (void)
|
||||
{
|
||||
pthread_exit (NULL);
|
||||
}
|
||||
@ -708,7 +708,7 @@ GThreadFunctions g_thread_functions_for_glib_use =
|
||||
g_thread_create_posix_impl,
|
||||
g_thread_yield,
|
||||
g_thread_join_posix_impl,
|
||||
g_thread_exit_posix_impl,
|
||||
g_system_thread_exit,
|
||||
g_thread_set_priority_posix_impl,
|
||||
g_thread_self_posix_impl,
|
||||
g_system_thread_equal,
|
||||
|
@ -371,8 +371,8 @@ g_thread_self_win32_impl (gpointer thread)
|
||||
*(GThreadData **)thread = self;
|
||||
}
|
||||
|
||||
static void
|
||||
g_thread_exit_win32_impl (void)
|
||||
void
|
||||
g_system_thread_exit (void)
|
||||
{
|
||||
GThreadData *self = TlsGetValue (g_thread_self_tls);
|
||||
gboolean dtors_called;
|
||||
@ -431,7 +431,7 @@ g_thread_proxy (gpointer data)
|
||||
|
||||
self->func (self->data);
|
||||
|
||||
g_thread_exit_win32_impl ();
|
||||
g_system_thread_exit ();
|
||||
|
||||
g_assert_not_reached ();
|
||||
|
||||
@ -807,10 +807,10 @@ GThreadFunctions g_thread_functions_for_glib_use =
|
||||
g_thread_create_win32_impl, /* thread */
|
||||
g_thread_yield,
|
||||
g_thread_join_win32_impl,
|
||||
g_thread_exit_win32_impl,
|
||||
g_system_thread_exit,
|
||||
g_thread_set_priority_win32_impl,
|
||||
g_thread_self_win32_impl,
|
||||
NULL /* no equal function necessary */
|
||||
g_system_thread_equal
|
||||
};
|
||||
|
||||
void
|
||||
|
@ -1817,11 +1817,9 @@ g_thread_create_full (GThreadFunc func,
|
||||
* of g_thread_join(). If the current thread is not joinable, @retval
|
||||
* is ignored. Calling
|
||||
*
|
||||
* <informalexample>
|
||||
* <programlisting>
|
||||
* |[
|
||||
* g_thread_exit (retval);
|
||||
* </programlisting>
|
||||
* </informalexample>
|
||||
* ]|
|
||||
*
|
||||
* is equivalent to returning @retval from the function @func, as given
|
||||
* to g_thread_create().
|
||||
@ -1835,7 +1833,8 @@ g_thread_exit (gpointer retval)
|
||||
{
|
||||
GRealThread* real = (GRealThread*) g_thread_self ();
|
||||
real->retval = retval;
|
||||
G_THREAD_CF (thread_exit, (void)0, ());
|
||||
|
||||
g_system_thread_exit ();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,6 +37,8 @@ G_BEGIN_DECLS
|
||||
G_GNUC_INTERNAL gboolean g_system_thread_equal (gpointer thread1,
|
||||
gpointer thread2);
|
||||
|
||||
G_GNUC_INTERNAL void g_system_thread_exit (void);
|
||||
|
||||
/* Is called from gthread/gthread-impl.c */
|
||||
void g_thread_init_glib (void);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user