Merge branch 'master' into ztex
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
diff --git a/api.c b/api.c
index e851d68..77ab5c2 100644
--- a/api.c
+++ b/api.c
@@ -2029,7 +2029,7 @@ static void send_result(SOCKETTYPE c, bool isjson)
}
-static void tidyup()
+static void tidyup(void *arg)
{
bye = 1;
@@ -2182,6 +2182,7 @@ void api(int api_thr_id)
bool did;
int i;
+ pthread_cleanup_push(tidyup, NULL);
my_thr_id = api_thr_id;
/* This should be done first to ensure curl has already called WSAStartup() in windows */
@@ -2392,5 +2393,5 @@ void api(int api_thr_id)
CLOSESOCKET(c);
}
die:
- tidyup();
+ pthread_cleanup_pop(true);
}
diff --git a/driver-opencl.c b/driver-opencl.c
index 6fb85d9..da9a597 100644
--- a/driver-opencl.c
+++ b/driver-opencl.c
@@ -1180,6 +1180,7 @@ static bool opencl_thread_prepare(struct thr_info *thr)
return false;
}
+ strcpy(name, "");
applog(LOG_INFO, "Init GPU thread %i GPU %i virtual GPU %i", i, gpu, virtual_gpu);
clStates[i] = initCl(virtual_gpu, name, sizeof(name));
if (!clStates[i]) {