2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-03 08:05:21 +00:00

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 *).
This commit is contained in:
Ondřej Surý
2019-12-04 10:41:40 +01:00
committed by Ondřej Surý
parent 84b557e7cb
commit 4f7d1298a8
2 changed files with 12 additions and 11 deletions

View File

@@ -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);
}
/*

View File

@@ -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