Commit 79f1215e304caba529af79e0148df5f951f815a2

Con Kolivas 2014-03-22T10:38:23

Use upgrade cglock variants in get_gbt_curl

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/cgminer.c b/cgminer.c
index 0ea92ae..8ac21ef 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -6895,12 +6895,13 @@ static void gen_solo_work(struct pool *pool, struct work *work);
  * avoiding holding the lock once we've set the bool. */
 static void get_gbt_curl(struct pool *pool, int poll)
 {
-	cg_wlock(&pool->gbt_lock);
+	cg_ilock(&pool->gbt_lock);
 	while (pool->gbt_curl_inuse) {
-		cg_wunlock(&pool->gbt_lock);
+		cg_uilock(&pool->gbt_lock);
 		cgsleep_ms(poll);
-		cg_wlock(&pool->gbt_lock);
+		cg_ilock(&pool->gbt_lock);
 	}
+	cg_ulock(&pool->gbt_lock);
 	pool->gbt_curl_inuse = true;
 	cg_wunlock(&pool->gbt_lock);
 }