mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-05-19 04:01:57 +02:00
Merge branch 'poolname' into 'master'
gthreadpool: Include prgname in thread name See merge request GNOME/glib!374
This commit is contained in:
commit
0b45ddc556
@ -31,6 +31,7 @@
|
|||||||
#include "gmain.h"
|
#include "gmain.h"
|
||||||
#include "gtestutils.h"
|
#include "gtestutils.h"
|
||||||
#include "gtimer.h"
|
#include "gtimer.h"
|
||||||
|
#include "gutils.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:thread_pools
|
* SECTION:thread_pools
|
||||||
@ -401,10 +402,15 @@ g_thread_pool_start_thread (GRealThreadPool *pool,
|
|||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
{
|
{
|
||||||
|
const gchar *prgname = g_get_prgname ();
|
||||||
|
gchar name[16] = "pool";
|
||||||
GThread *thread;
|
GThread *thread;
|
||||||
|
|
||||||
|
if (prgname)
|
||||||
|
g_snprintf (name, sizeof (name), "pool-%s", prgname);
|
||||||
|
|
||||||
/* 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_new ("pool", g_thread_pool_thread_proxy, pool, error);
|
thread = g_thread_try_new (name, g_thread_pool_thread_proxy, pool, error);
|
||||||
|
|
||||||
if (thread == NULL)
|
if (thread == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user