mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
gthread: remove impl init functions
This commit is contained in:
parent
2539bd007d
commit
42af8eb39d
@ -480,18 +480,8 @@ g_private_set (GPrivate *key,
|
||||
|
||||
#define posix_check_cmd(cmd) posix_check_err (cmd, #cmd)
|
||||
|
||||
static gulong g_thread_min_stack_size = 0;
|
||||
|
||||
#define G_MUTEX_SIZE (sizeof (pthread_mutex_t))
|
||||
|
||||
void
|
||||
_g_thread_impl_init(void)
|
||||
{
|
||||
#ifdef _SC_THREAD_STACK_MIN
|
||||
g_thread_min_stack_size = MAX (sysconf (_SC_THREAD_STACK_MIN), 0);
|
||||
#endif /* _SC_THREAD_STACK_MIN */
|
||||
}
|
||||
|
||||
void
|
||||
g_system_thread_create (GThreadFunc thread_func,
|
||||
gpointer arg,
|
||||
@ -510,7 +500,9 @@ g_system_thread_create (GThreadFunc thread_func,
|
||||
#ifdef HAVE_PTHREAD_ATTR_SETSTACKSIZE
|
||||
if (stack_size)
|
||||
{
|
||||
stack_size = MAX (g_thread_min_stack_size, stack_size);
|
||||
#ifdef _SC_THREAD_STACK_MIN
|
||||
stack_size = MAX (sysconf (_SC_THREAD_STACK_MIN), stack_size);
|
||||
#endif /* _SC_THREAD_STACK_MIN */
|
||||
/* No error check here, because some systems can't do it and
|
||||
* we simply don't want threads to fail because of that. */
|
||||
pthread_attr_setstacksize (&attr, stack_size);
|
||||
|
@ -858,23 +858,6 @@ g_thread_xp_init (void)
|
||||
|
||||
/* {{{1 Epilogue */
|
||||
|
||||
void
|
||||
_g_thread_impl_init (void)
|
||||
{
|
||||
static gboolean beenhere = FALSE;
|
||||
|
||||
if (beenhere)
|
||||
return;
|
||||
|
||||
beenhere = TRUE;
|
||||
|
||||
printf ("thread init\n");
|
||||
win32_check_for_error (TLS_OUT_OF_INDEXES !=
|
||||
(g_thread_self_tls = TlsAlloc ()));
|
||||
win32_check_for_error (TLS_OUT_OF_INDEXES !=
|
||||
(g_private_tls = TlsAlloc ()));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
g_thread_lookup_native_funcs (void)
|
||||
{
|
||||
@ -916,6 +899,9 @@ g_thread_DllMain (void)
|
||||
fprintf (stderr, "(debug) GThread using Windows XP mode\n");
|
||||
g_thread_xp_init ();
|
||||
}
|
||||
|
||||
win32_check_for_error (TLS_OUT_OF_INDEXES != (g_thread_self_tls = TlsAlloc ()));
|
||||
win32_check_for_error (TLS_OUT_OF_INDEXES != (g_private_tls = TlsAlloc ()));
|
||||
}
|
||||
|
||||
/* vim:set foldmethod=marker: */
|
||||
|
@ -657,8 +657,6 @@ g_thread_init_glib (void)
|
||||
|
||||
already_done = TRUE;
|
||||
|
||||
_g_thread_impl_init ();
|
||||
|
||||
/* We let the main thread (the one that calls g_thread_init) inherit
|
||||
* the static_private data set before calling g_thread_init
|
||||
*/
|
||||
|
@ -53,9 +53,6 @@ void g_thread_init_glib (void);
|
||||
/* initializers that may also use g_private_new() */
|
||||
G_GNUC_INTERNAL void _g_messages_thread_init_nomessage (void);
|
||||
|
||||
/* full fledged initializers */
|
||||
G_GNUC_INTERNAL void _g_thread_impl_init (void);
|
||||
|
||||
struct _GPrivate
|
||||
{
|
||||
gpointer single_value;
|
||||
|
Loading…
Reference in New Issue
Block a user