[glib] drop g_thread_new_full()



commit 332f74a2fc40da5d8f9313020468ed27e56b2b14
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu Oct 13 01:17:36 2011 -0400

    drop g_thread_new_full()
    
    We'll hold out on this until someone has a really convincing reason for
    why they need to control the stack size.
    
    If we do decide to add it back, it should probably have a name like
    _new_with_stack_size(), not _full().

 glib/deprecated/gthread-deprecated.c |    2 +-
 glib/deprecated/gthread.h            |    2 +-
 glib/glib.symbols                    |    1 -
 glib/gthread.c                       |   51 +++------------------------------
 glib/gthread.h                       |    5 ---
 glib/tests/thread.c                  |    6 ++--
 6 files changed, 10 insertions(+), 57 deletions(-)
---
diff --git a/glib/deprecated/gthread-deprecated.c b/glib/deprecated/gthread-deprecated.c
index 3a01799..c6aa3ef 100644
--- a/glib/deprecated/gthread-deprecated.c
+++ b/glib/deprecated/gthread-deprecated.c
@@ -350,7 +350,7 @@ g_thread_create (GThreadFunc   func,
  * This function creates a new thread.
  *
  * Deprecated:2.32: The @bound and @priority arguments are now ignored.
- * Use g_thread_new() or g_thread_new_full() instead.
+ * Use g_thread_new().
  */
 GThread *
 g_thread_create_full (GThreadFunc       func,
diff --git a/glib/deprecated/gthread.h b/glib/deprecated/gthread.h
index b375a49..fcecd1e 100644
--- a/glib/deprecated/gthread.h
+++ b/glib/deprecated/gthread.h
@@ -102,7 +102,7 @@ GThread *g_thread_create       (GThreadFunc       func,
                                 gboolean          joinable,
                                 GError          **error);
 
-GLIB_DEPRECATED_FOR(g_thread_new_full)
+GLIB_DEPRECATED_FOR(g_thread_new)
 GThread *g_thread_create_full  (GThreadFunc       func,
                                 gpointer          data,
                                 gulong            stack_size,
diff --git a/glib/glib.symbols b/glib/glib.symbols
index b156bcc..48738fe 100644
--- a/glib/glib.symbols
+++ b/glib/glib.symbols
@@ -1099,7 +1099,6 @@ g_thread_functions_for_glib_use
 g_thread_init_glib
 g_thread_join
 g_thread_new
-g_thread_new_full
 g_thread_ref
 g_thread_self
 g_thread_set_priority
diff --git a/glib/gthread.c b/glib/gthread.c
index 2cdac53..331b471 100644
--- a/glib/gthread.c
+++ b/glib/gthread.c
@@ -412,9 +412,9 @@
  * GThread:
  *
  * The #GThread struct represents a running thread. This struct
- * is returned by g_thread_new() or g_thread_new_full(). You can
- * obtain the #GThread struct representing the current thead by
- * calling g_thread_self().
+ * is returned by g_thread_new() or g_thread_try(). You can obtain the
+ * #GThread struct representing the current thead by calling
+ * g_thread_self().
  *
  * The structure is opaque -- none of its fields may be directly
  * accessed.
@@ -424,8 +424,8 @@
  * GThreadFunc:
  * @data: data passed to the thread
  *
- * Specifies the type of the @func functions passed to
- * g_thread_new() or g_thread_new_full().
+ * Specifies the type of the @func functions passed to g_thread_new() or
+ * g_thread_try().
  *
  * Returns: the return value of the thread
  */
@@ -780,47 +780,6 @@ g_thread_try (const gchar  *name,
   return g_thread_new_internal (name, g_thread_proxy, func, data, 0, error);
 }
 
-
-/**
- * g_thread_new_full:
- * @name: a name for the new thread
- * @func: a function to execute in the new thread
- * @data: an argument to supply to the new thread
- * @stack_size: a stack size for the new thread
- * @error: return location for error
- *
- * This function creates a new thread. The new thread starts by
- * invoking @func with the argument data. The thread will run
- * until @func returns or until g_thread_exit() is called.
- *
- * The @name can be useful for discriminating threads in
- * a debugger. Some systems restrict the length of @name to
- * 16 bytes.
- *
- * 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. Note that you should only
- * use a non-zero @stack_size if you really can't use the default.
- * In most cases, using g_thread_new() (which doesn't take a
- * @stack_size) is better.
- *
- * @error can be %NULL to ignore errors, or non-%NULL to report errors.
- * The error is set, if and only if the function returns %NULL.
- *
- * Returns: the new #GThread, or %NULL if an error occurred
- *
- * Since: 2.32
- */
-GThread *
-g_thread_new_full (const gchar  *name,
-                   GThreadFunc   func,
-                   gpointer      data,
-                   gsize         stack_size,
-                   GError      **error)
-{
-  return g_thread_new_internal (name, g_thread_proxy, func, data, stack_size, error);
-}
-
 GThread *
 g_thread_new_internal (const gchar   *name,
                        GThreadFunc    proxy,
diff --git a/glib/gthread.h b/glib/gthread.h
index 6400f69..6afffa1 100644
--- a/glib/gthread.h
+++ b/glib/gthread.h
@@ -146,11 +146,6 @@ GThread *       g_thread_try                    (const gchar    *name,
                                                  GThreadFunc     func,
                                                  gpointer        data,
                                                  GError        **error);
-GThread *       g_thread_new_full               (const gchar    *name,
-                                                 GThreadFunc     func,
-                                                 gpointer        data,
-                                                 gsize           stack_size,
-                                                 GError        **error);
 GThread *       g_thread_self                   (void);
 void            g_thread_exit                   (gpointer        retval);
 gpointer        g_thread_join                   (GThread        *thread);
diff --git a/glib/tests/thread.c b/glib/tests/thread.c
index e418d01..5d052b0 100644
--- a/glib/tests/thread.c
+++ b/glib/tests/thread.c
@@ -107,9 +107,9 @@ test_thread3 (void)
   gpointer result;
   GThread *thread1, *thread2, *thread3;
 
-  thread1 = g_thread_new_full ("a", thread3_func, NULL, 0, NULL);
-  thread2 = g_thread_new_full ("b", thread3_func, thread1, 100, NULL);
-  thread3 = g_thread_new_full ("c", thread3_func, thread2, 100000, NULL);
+  thread1 = g_thread_new ("a", thread3_func, NULL);
+  thread2 = g_thread_new ("b", thread3_func, thread1);
+  thread3 = g_thread_new ("c", thread3_func, thread2);
 
   result = g_thread_join (thread3);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]