summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/syncop.c
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/syncop.c')
-rw-r--r--libglusterfs/src/syncop.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index 544cfdc011a..b36c88dc829 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -712,6 +712,7 @@ syncenv_scale (struct syncenv *env)
int scale = 0;
int i = 0;
int ret = 0;
+ char thread_name[GF_THREAD_NAMEMAX] = {0,};
pthread_mutex_lock (&env->mutex);
{
@@ -731,8 +732,11 @@ syncenv_scale (struct syncenv *env)
}
env->proc[i].env = env;
+ snprintf (thread_name, sizeof(thread_name),
+ "%s%d", "sproc", env->procs);
ret = gf_thread_create (&env->proc[i].processor, NULL,
- syncenv_processor, &env->proc[i]);
+ syncenv_processor,
+ &env->proc[i], thread_name);
if (ret)
break;
env->procs++;
@@ -796,6 +800,7 @@ syncenv_new (size_t stacksize, int procmin, int procmax)
struct syncenv *newenv = NULL;
int ret = 0;
int i = 0;
+ char thread_name[GF_THREAD_NAMEMAX] = {0,};
if (!procmin || procmin < 0)
procmin = SYNCENV_PROC_MIN;
@@ -824,8 +829,11 @@ syncenv_new (size_t stacksize, int procmin, int procmax)
for (i = 0; i < newenv->procmin; i++) {
newenv->proc[i].env = newenv;
+ snprintf (thread_name, sizeof(thread_name),
+ "%s%d", "sproc", (newenv->procs));
ret = gf_thread_create (&newenv->proc[i].processor, NULL,
- syncenv_processor, &newenv->proc[i]);
+ syncenv_processor, &newenv->proc[i],
+ thread_name);
if (ret)
break;
newenv->procs++;