Commit b6ae1db838d15c1bfcdfcff3dfd7be427ee59d3a

Con Kolivas 2011-06-26T10:53:16

The submit_lock is not required nor helpful.

diff --git a/cpu-miner.c b/cpu-miner.c
index 6f7be53..3bf7d65 100644
--- a/cpu-miner.c
+++ b/cpu-miner.c
@@ -145,7 +145,6 @@ int longpoll_thr_id;
 struct work_restart *work_restart = NULL;
 pthread_mutex_t time_lock;
 static pthread_mutex_t hash_lock;
-static pthread_mutex_t submit_lock;
 static pthread_mutex_t get_lock;
 static double total_mhashes_done;
 static struct timeval total_tv_start, total_tv_end;
@@ -470,9 +469,6 @@ static void *submit_thread(void *userdata)
 	int failures = 0;
 	CURL *curl;
 
-	/* libcurl seems to be not thread safe so only submit one at a time! */
-	pthread_mutex_lock(&submit_lock);
-
 	curl = curl_easy_init();
 	if (unlikely(!curl)) {
 		applog(LOG_ERR, "CURL initialization failed");
@@ -496,7 +492,6 @@ static void *submit_thread(void *userdata)
 
 	free(hexstr);
 	curl_easy_cleanup(curl);
-	pthread_mutex_unlock(&submit_lock);
 	return NULL;
 }
 
@@ -1320,8 +1315,6 @@ int main (int argc, char *argv[])
 		return 1;
 	if (unlikely(pthread_mutex_init(&hash_lock, NULL)))
 		return 1;
-	if (unlikely(pthread_mutex_init(&submit_lock, NULL)))
-		return 1;
 	if (unlikely(pthread_mutex_init(&get_lock, NULL)))
 		return 1;