Merge branch '1555-code-with-pthread-specific-semantics-is-not-portable' into 'master'

Resolve "Code with pthread specific semantics is not portable"

Closes #1555

See merge request isc-projects/bind9!2868
This commit is contained in:
Ondřej Surý 2020-01-13 08:54:54 +00:00
commit 98136164aa
3 changed files with 14 additions and 12 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

View file

@ -48,7 +48,7 @@ static isc_timer_t *timer = NULL;
static isc_condition_t cv;
static isc_mutex_t mx;
static isc_time_t endtime;
static isc_mutex_t lasttime_mx = PTHREAD_MUTEX_INITIALIZER;
static isc_mutex_t lasttime_mx;
static isc_time_t lasttime;
static int seconds;
static int nanoseconds;
@ -112,6 +112,7 @@ setup_test(isc_timertype_t timertype, isc_time_t *expires,
atomic_init(&eventcnt, 0);
isc_mutex_init(&mx);
isc_mutex_init(&lasttime_mx);
isc_condition_init(&cv);