mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
Rename g_thread_try to g_thread_try_new
This commit is contained in:
parent
4417e77f17
commit
e75e9c3044
@ -591,7 +591,7 @@ GThreadError
|
|||||||
GThread
|
GThread
|
||||||
GThreadFunc
|
GThreadFunc
|
||||||
g_thread_new
|
g_thread_new
|
||||||
g_thread_try
|
g_thread_try_new
|
||||||
g_thread_ref
|
g_thread_ref
|
||||||
g_thread_unref
|
g_thread_unref
|
||||||
g_thread_join
|
g_thread_join
|
||||||
|
@ -1102,7 +1102,7 @@ g_thread_new
|
|||||||
g_thread_ref
|
g_thread_ref
|
||||||
g_thread_self
|
g_thread_self
|
||||||
g_thread_set_priority
|
g_thread_set_priority
|
||||||
g_thread_try
|
g_thread_try_new
|
||||||
g_thread_use_default_impl
|
g_thread_use_default_impl
|
||||||
g_thread_unref
|
g_thread_unref
|
||||||
g_thread_yield
|
g_thread_yield
|
||||||
|
@ -422,8 +422,8 @@
|
|||||||
* GThread:
|
* GThread:
|
||||||
*
|
*
|
||||||
* The #GThread struct represents a running thread. This struct
|
* The #GThread struct represents a running thread. This struct
|
||||||
* is returned by g_thread_new() or g_thread_try(). You can obtain the
|
* is returned by g_thread_new() or g_thread_try_new(). You can obtain
|
||||||
* #GThread struct representing the current thead by calling
|
* the #GThread struct representing the current thead by calling
|
||||||
* g_thread_self().
|
* g_thread_self().
|
||||||
*
|
*
|
||||||
* The structure is opaque -- none of its fields may be directly
|
* The structure is opaque -- none of its fields may be directly
|
||||||
@ -435,7 +435,7 @@
|
|||||||
* @data: data passed to the thread
|
* @data: data passed to the thread
|
||||||
*
|
*
|
||||||
* Specifies the type of the @func functions passed to g_thread_new() or
|
* Specifies the type of the @func functions passed to g_thread_new() or
|
||||||
* g_thread_try().
|
* g_thread_try_new().
|
||||||
*
|
*
|
||||||
* Returns: the return value of the thread
|
* Returns: the return value of the thread
|
||||||
*/
|
*/
|
||||||
@ -742,7 +742,7 @@ g_thread_proxy (gpointer data)
|
|||||||
* 16 bytes.
|
* 16 bytes.
|
||||||
*
|
*
|
||||||
* If the thread can not be created the program aborts. See
|
* If the thread can not be created the program aborts. See
|
||||||
* g_thread_try() if you want to attempt to deal with failures.
|
* g_thread_try_new() if you want to attempt to deal with failures.
|
||||||
*
|
*
|
||||||
* Returns: the new #GThread
|
* Returns: the new #GThread
|
||||||
*
|
*
|
||||||
@ -765,7 +765,7 @@ g_thread_new (const gchar *name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* g_thread_try:
|
* g_thread_try_new:
|
||||||
* @name: a name for the new thread
|
* @name: a name for the new thread
|
||||||
* @func: a function to execute in the new thread
|
* @func: a function to execute in the new thread
|
||||||
* @data: an argument to supply to the new thread
|
* @data: an argument to supply to the new thread
|
||||||
@ -782,10 +782,10 @@ g_thread_new (const gchar *name,
|
|||||||
* Since: 2.32
|
* Since: 2.32
|
||||||
*/
|
*/
|
||||||
GThread *
|
GThread *
|
||||||
g_thread_try (const gchar *name,
|
g_thread_try_new (const gchar *name,
|
||||||
GThreadFunc func,
|
GThreadFunc func,
|
||||||
gpointer data,
|
gpointer data,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
return g_thread_new_internal (name, g_thread_proxy, func, data, 0, error);
|
return g_thread_new_internal (name, g_thread_proxy, func, data, 0, error);
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ void g_thread_unref (GThread *thread);
|
|||||||
GThread * g_thread_new (const gchar *name,
|
GThread * g_thread_new (const gchar *name,
|
||||||
GThreadFunc func,
|
GThreadFunc func,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
GThread * g_thread_try (const gchar *name,
|
GThread * g_thread_try_new (const gchar *name,
|
||||||
GThreadFunc func,
|
GThreadFunc func,
|
||||||
gpointer data,
|
gpointer data,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
@ -414,7 +414,7 @@ g_thread_pool_start_thread (GRealThreadPool *pool,
|
|||||||
GThread *thread;
|
GThread *thread;
|
||||||
|
|
||||||
/* No thread was found, we have to start a new one */
|
/* No thread was found, we have to start a new one */
|
||||||
thread = g_thread_try ("pool", g_thread_pool_thread_proxy, pool, error);
|
thread = g_thread_try_new ("pool", g_thread_pool_thread_proxy, pool, error);
|
||||||
|
|
||||||
if (thread == NULL)
|
if (thread == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -50,7 +50,7 @@ test_thread1 (void)
|
|||||||
GThread *thread;
|
GThread *thread;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
thread = g_thread_try ("test", thread1_func, NULL, &error);
|
thread = g_thread_try_new ("test", thread1_func, NULL, &error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
|
|
||||||
result = g_thread_join (thread);
|
result = g_thread_join (thread);
|
||||||
@ -135,7 +135,7 @@ test_thread4 (void)
|
|||||||
g_error ("prlimit failed: %s\n", g_strerror (ret));
|
g_error ("prlimit failed: %s\n", g_strerror (ret));
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
thread = g_thread_try ("a", thread1_func, NULL, &error);
|
thread = g_thread_try_new ("a", thread1_func, NULL, &error);
|
||||||
g_assert (thread == NULL);
|
g_assert (thread == NULL);
|
||||||
g_assert_error (error, G_THREAD_ERROR, G_THREAD_ERROR_AGAIN);
|
g_assert_error (error, G_THREAD_ERROR, G_THREAD_ERROR_AGAIN);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
Loading…
Reference in New Issue
Block a user