Browse Source

Rename longpoll threads according to what pool they're associated with

Cherrypicked from f3ce5777a270caa2b672396a61040c321eda310d

Conflicts:
	miner.c
Con Kolivas 13 years ago
parent
commit
ebaf3898fd
1 changed files with 4 additions and 2 deletions
  1. 4 2
      miner.c

+ 4 - 2
miner.c

@@ -6999,8 +6999,9 @@ static void *longpoll_thread(void *userdata)
 	struct pool *cp = (struct pool *)userdata;
 	struct pool *cp = (struct pool *)userdata;
 	/* This *pool is the source of the actual longpoll, not the pool we've
 	/* This *pool is the source of the actual longpoll, not the pool we've
 	 * tied it to */
 	 * tied it to */
-	struct pool *pool = NULL;
 	struct timeval start, reply, end;
 	struct timeval start, reply, end;
+	struct pool *pool = NULL;
+	char threadname[20];
 	CURL *curl = NULL;
 	CURL *curl = NULL;
 	int failures = 0;
 	int failures = 0;
 	char *lp_url;
 	char *lp_url;
@@ -7010,7 +7011,8 @@ static void *longpoll_thread(void *userdata)
 	pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
 	pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
 #endif
 #endif
 
 
-	RenameThread("longpoll");
+	snprintf(threadname, 20, "longpoll%u", cp->pool_no);
+	RenameThread(threadname);
 
 
 	curl = curl_easy_init();
 	curl = curl_easy_init();
 	if (unlikely(!curl)) {
 	if (unlikely(!curl)) {