Browse Source

Merge commit '419083a' into cg_merges_20130513

Conflicts:
	miner.h
Luke Dashjr 12 years ago
parent
commit
9489b8b05b
2 changed files with 4 additions and 0 deletions
  1. 3 0
      api.c
  2. 1 0
      miner.h

+ 3 - 0
api.c

@@ -2184,13 +2184,16 @@ static void switchpool(struct io_data *io_data, __maybe_unused SOCKETTYPE c, cha
 	}
 
 	id = atoi(param);
+	mutex_lock(&control_lock);
 	if (id < 0 || id >= total_pools) {
+		mutex_unlock(&control_lock);
 		message(io_data, MSG_INVPID, id, NULL, isjson);
 		return;
 	}
 
 	pool = pools[id];
 	pool->enabled = POOL_ENABLED;
+	mutex_unlock(&control_lock);
 	switch_pools(pool);
 
 	message(io_data, MSG_SWITCHP, id, NULL, isjson);

+ 1 - 0
miner.h

@@ -809,6 +809,7 @@ extern int opt_queue;
 extern int opt_scantime;
 extern int opt_expiry;
 
+extern pthread_mutex_t control_lock;
 extern pthread_mutex_t hash_lock;
 extern pthread_mutex_t console_lock;
 extern pthread_mutex_t ch_lock;