Allow setstacksize to fail. (#304790, Michael Banck)

2005-06-09  Matthias Clasen  <mclasen@redhat.com>

	* gthread-posix.c (g_thread_create_posix_impl): Allow
	setstacksize to fail.  (#304790, Michael Banck)
This commit is contained in:
Matthias Clasen 2005-06-09 15:27:14 +00:00 committed by Matthias Clasen
parent ad71d36473
commit 1d28558146
4 changed files with 16 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2005-06-09 Matthias Clasen <mclasen@redhat.com>
* glib/tmpl/threads.sgml: Document that stack size is
ignored if the underlying system doesn't support it.
2005-05-20 Matthias Clasen <mclasen@redhat.com> 2005-05-20 Matthias Clasen <mclasen@redhat.com>
* glib/compiling.sgml: Update an example from 1.3 to 2.x * glib/compiling.sgml: Update an example from 1.3 to 2.x

View File

@ -292,9 +292,9 @@ error is set, if and only if the function returns %NULL.
<!-- ##### FUNCTION g_thread_create_full ##### --> <!-- ##### FUNCTION g_thread_create_full ##### -->
<para> <para>
This function creates a new thread with the priority @priority. The This function creates a new thread with the priority @priority. If the
stack gets the size @stack_size or the default value for the current underlying thread implementation supports it, the thread gets a stack size
platform, if @stack_size is 0. of @stack_size or the default value for the current platform, if @stack_size is 0.
</para> </para>
<para> <para>

View File

@ -1,3 +1,8 @@
2005-06-09 Matthias Clasen <mclasen@redhat.com>
* gthread-posix.c (g_thread_create_posix_impl): Allow
setstacksize to fail. (#304790, Michael Banck)
2005-04-06 Matthias Clasen <mclasen@redhat.com> 2005-04-06 Matthias Clasen <mclasen@redhat.com>
* === Released 2.6.4 === * === Released 2.6.4 ===

View File

@ -307,7 +307,9 @@ g_thread_create_posix_impl (GThreadFunc thread_func,
if (stack_size) if (stack_size)
{ {
stack_size = MAX (g_thread_min_stack_size, 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 */ #endif /* HAVE_PTHREAD_ATTR_SETSTACKSIZE */