From f15bb122cec96ec2a7744f276821d65478b5e695 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 9 Jun 2005 15:25:01 +0000 Subject: [PATCH] Allow setstacksize to fail. (#304790, Michael Banck) 2005-06-09 Matthias Clasen * gthread-posix.c (g_thread_create_posix_impl): Allow setstacksize to fail. (#304790, Michael Banck) --- docs/reference/ChangeLog | 6 ++++++ docs/reference/glib/tmpl/threads.sgml | 6 +++--- gthread/ChangeLog | 5 +++++ gthread/gthread-posix.c | 4 +++- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index 0c965b34..45a1fa02 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,9 @@ +2005-06-09 Matthias Clasen + + * glib/tmpl/threads.sgml: Document that stack size + will be ignored if the underlying thread implementation + doesn't support stack sizes. + 2005-06-07 Matthias Clasen * glib/glib-sections.txt: Add g_utf8_collate_key_for_filename. diff --git a/docs/reference/glib/tmpl/threads.sgml b/docs/reference/glib/tmpl/threads.sgml index 5ec8f94c..69396e42 100644 --- a/docs/reference/glib/tmpl/threads.sgml +++ b/docs/reference/glib/tmpl/threads.sgml @@ -306,9 +306,9 @@ error is set, if and only if the function returns %NULL. -This function creates a new thread with the priority @priority. The -stack gets the size @stack_size or the default value for the current -platform, if @stack_size is 0. +This function creates a new thread with the priority @priority. If the +underlying thread implementation supports it, the thread gets a stack size +of @stack_size or the default value for the current platform, if @stack_size is 0. diff --git a/gthread/ChangeLog b/gthread/ChangeLog index ca5e4677..6e848363 100644 --- a/gthread/ChangeLog +++ b/gthread/ChangeLog @@ -1,3 +1,8 @@ +2005-06-09 Matthias Clasen + + * gthread-posix.c (g_thread_create_posix_impl): Allow + setstacksize to fail. (#304790, Michael Banck) + 2005-01-07 Matthias Clasen * === Released 2.6.1 === diff --git a/gthread/gthread-posix.c b/gthread/gthread-posix.c index 0dcf6bb7..0ead204a 100644 --- a/gthread/gthread-posix.c +++ b/gthread/gthread-posix.c @@ -307,7 +307,9 @@ g_thread_create_posix_impl (GThreadFunc thread_func, if (stack_size) { stack_size = MAX (g_thread_min_stack_size, stack_size); - posix_check_cmd (pthread_attr_setstacksize (&attr, stack_size)); + /* 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); } #endif /* HAVE_PTHREAD_ATTR_SETSTACKSIZE */ -- 2.34.1