#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,
gulong stack_size,
#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);
/* {{{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)
{
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: */
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
*/
/* 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;