From: Ondřej Surý Date: Wed, 4 Dec 2019 09:41:40 +0000 (+0100) Subject: Use isc_threadresult_t instead of pthread specific void * return type X-Git-Tag: v9.15.8~19^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f7d1298a8e35adf9c8aab08360d288cdf0c0b95;p=thirdparty%2Fbind9.git Use isc_threadresult_t instead of pthread specific void * return type The ISC thread API already defines isc_threadresult_t type, but we are using a pthread specific return type (void *). --- diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c index 0fdd215df1d..fe1f898cb22 100644 --- a/lib/isc/netmgr/netmgr.c +++ b/lib/isc/netmgr/netmgr.c @@ -53,8 +53,8 @@ static void nmsocket_maybe_destroy(isc_nmsocket_t *sock); static void nmhandle_free(isc_nmsocket_t *sock, isc_nmhandle_t *handle); -static void * -nm_thread(void *worker0); +static isc_threadresult_t +nm_thread(isc_threadarg_t worker0); static void async_cb(uv_async_t *handle); static void @@ -406,8 +406,8 @@ isc_nm_tcp_gettimeouts(isc_nm_t *mgr, uint32_t *initial, uint32_t *idle, * nm_thread is a single worker thread, that runs uv_run event loop * until asked to stop. */ -static void * -nm_thread(void *worker0) { +static isc_threadresult_t +nm_thread(isc_threadarg_t worker0) { isc__networker_t *worker = (isc__networker_t *) worker0; isc__nm_tid_v = worker->id; @@ -496,7 +496,8 @@ nm_thread(void *worker0) { memory_order_relaxed); SIGNAL(&worker->mgr->wkstatecond); UNLOCK(&worker->mgr->lock); - return (NULL); + + return ((isc_threadresult_t)0); } /* diff --git a/lib/isc/tests/mem_test.c b/lib/isc/tests/mem_test.c index c237ef23cd3..a923cc58d21 100644 --- a/lib/isc/tests/mem_test.c +++ b/lib/isc/tests/mem_test.c @@ -380,8 +380,8 @@ isc_mem_traceflag_test(void **state) { #define NUM_ITEMS 1024 //768 #define ITEM_SIZE 65534 -static void * -mem_thread(void *arg) { +static isc_threadresult_t +mem_thread(isc_threadarg_t arg) { void *items[NUM_ITEMS]; size_t size = *((size_t *)arg); @@ -394,7 +394,7 @@ mem_thread(void *arg) { } } - return (NULL); + return ((isc_threadresult_t)0); } static void @@ -430,8 +430,8 @@ isc_mem_benchmark(void **state) { (nthreads * ITERS * NUM_ITEMS) / (t / 1000000.0)); } -static void * -mempool_thread(void *arg) { +static isc_threadresult_t +mempool_thread(isc_threadarg_t arg) { isc_mempool_t *mp = (isc_mempool_t *)arg; void *items[NUM_ITEMS]; @@ -444,7 +444,7 @@ mempool_thread(void *arg) { } } - return (NULL); + return ((isc_threadresult_t)0); } static void