REQUIRE(name != NULL);
isc_loop_t *loop = isc_loop();
- uint32_t tid = isc_tid();
+ isc_tid_t tid = isc_tid();
struct cds_list_head *lru = &bc->lru[tid];
isc_stdtime_t now = isc_stdtime_now();
}
}
- uint32_t tid = isc_tid();
+ isc_tid_t tid = isc_tid();
struct cds_list_head *lru = &bc->lru[tid];
bcentry_purge(ht, lru, now);
struct dns_dispatch {
/* Unlocked. */
unsigned int magic; /*%< magic */
- uint32_t tid;
+ isc_tid_t tid;
isc_socktype_t socktype;
isc_refcount_t references;
isc_mem_t *mctx;
dispentry_cancel(dns_dispentry_t *resp, isc_result_t result);
static isc_result_t
dispatch_createudp(dns_dispatchmgr_t *mgr, const isc_sockaddr_t *localaddr,
- uint32_t tid, dns_dispatch_t **dispp);
+ isc_tid_t tid, dns_dispatch_t **dispp);
static void
udp_startrecv(isc_nmhandle_t *handle, dns_dispentry_t *resp);
static void
* Allocate and set important limits.
*/
static void
-dispatch_allocate(dns_dispatchmgr_t *mgr, isc_socktype_t type, uint32_t tid,
+dispatch_allocate(dns_dispatchmgr_t *mgr, isc_socktype_t type, isc_tid_t tid,
dns_dispatch_t **dispp) {
dns_dispatch_t *disp = NULL;
dns_transport_t *transport, dns_dispatchopt_t options,
dns_dispatch_t **dispp) {
dns_dispatch_t *disp = NULL;
- uint32_t tid = isc_tid();
+ isc_tid_t tid = isc_tid();
REQUIRE(VALID_DISPATCHMGR(mgr));
REQUIRE(destaddr != NULL);
dns_dispatch_t *disp_connected = NULL;
dns_dispatch_t *disp_fallback = NULL;
isc_result_t result = ISC_R_NOTFOUND;
- uint32_t tid = isc_tid();
+ isc_tid_t tid = isc_tid();
REQUIRE(VALID_DISPATCHMGR(mgr));
REQUIRE(destaddr != NULL);
static isc_result_t
dispatch_createudp(dns_dispatchmgr_t *mgr, const isc_sockaddr_t *localaddr,
- uint32_t tid, dns_dispatch_t **dispp) {
+ isc_tid_t tid, dns_dispatch_t **dispp) {
isc_result_t result = ISC_R_SUCCESS;
dns_dispatch_t *disp = NULL;
isc_sockaddr_t sa_any;
static void
dispatch_destroy(dns_dispatch_t *disp) {
dns_dispatchmgr_t *mgr = disp->mgr;
- uint32_t tid = isc_tid();
+ isc_tid_t tid = isc_tid();
disp->magic = 0;
dns_dispatch_t *
dns_dispatchset_get(dns_dispatchset_t *dset) {
- uint32_t tid = isc_tid();
+ isc_tid_t tid = isc_tid();
/* check that dispatch set is configured */
if (dset == NULL || dset->ndisp == 0) {
return NULL;
}
- INSIST(tid < dset->ndisp);
+ INSIST((uint32_t)tid < dset->ndisp);
return dset->dispatches[tid];
}
*/
typedef struct dns_qpread {
DNS_QPREADER_FIELDS;
- uint32_t tid;
+ isc_tid_t tid;
} dns_qpread_t;
/*%
unsigned int magic;
dns_view_t *view;
isc_loop_t *loop;
- uint32_t tid;
+ isc_tid_t tid;
isc_refcount_t references;
/* Name and type of the response to be validated. */
***/
void
-dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx, unsigned int tid);
+dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx, isc_tid_t tid);
/*%<
* Creates a new empty zone and attach '*zonep' to it.
*
if (isc_log_wouldlog(ISC_LOG_DEBUG(7))) { \
isc_log_write(DNS_LOGCATEGORY_DATABASE, \
DNS_LOGMODULE_QP, ISC_LOG_DEBUG(7), \
- "%s:%d:%s(qp %p uctx \"%s\"):t%u: " fmt, \
+ "%s:%d:%s(qp %p uctx \"%s\"):t%" PRItid \
+ ": " fmt, \
__FILE__, __LINE__, __func__, qp, \
qp ? TRIENAME(qp) : "(null)", isc_tid(), \
##__VA_ARGS__); \
int32_t flags;
isc_loop_t *loop;
- unsigned int tid;
+ isc_tid_t tid;
isc_result_t result;
isc_job_cb cb;
static void
requests_cancel(void *arg) {
dns_requestmgr_t *requestmgr = arg;
- uint32_t tid = isc_tid();
+ isc_tid_t tid = isc_tid();
ISC_LIST_FOREACH (requestmgr->requests[tid], request, link) {
- req_log(ISC_LOG_DEBUG(3), "%s(%" PRIu32 ": request %p",
+ req_log(ISC_LOG_DEBUG(3), "%s(%" PRItid ": request %p",
__func__, tid, request);
if (DNS_REQUEST_COMPLETE(request)) {
/* The callback has been already scheduled */
*/
synchronize_rcu();
- uint32_t tid = isc_tid();
+ isc_tid_t tid = isc_tid();
uint32_t nloops = isc_loopmgr_nloops(requestmgr->loopmgr);
for (size_t i = 0; i < nloops; i++) {
dns_requestmgr_ref(requestmgr);
- if (i == tid) {
+ if (i == (uint32_t)tid) {
/* Run the current loop synchronously */
requests_cancel(requestmgr);
continue;
isc_stdtime_t now;
isc_loop_t *loop;
- unsigned int tid;
+ isc_tid_t tid;
dns_edectx_t edectx;
REQUIRE(local != NULL);
isc_loop_t *loop = isc_loop();
- uint32_t tid = isc_tid();
+ isc_tid_t tid = isc_tid();
struct cds_list_head *lru = &uc->lru[tid];
isc_stdtime_t now = isc_stdtime_now();
isc_stdtime_t expire = now + uc->expire_min_s;
result = ISC_R_SUCCESS;
}
- uint32_t tid = isc_tid();
+ isc_tid_t tid = isc_tid();
struct cds_list_head *lru = &uc->lru[tid];
ucentry_purge(ht, lru, now);
ucentry_evict(ht, found);
}
- uint32_t tid = isc_tid();
+ isc_tid_t tid = isc_tid();
struct cds_list_head *lru = &uc->lru[tid];
ucentry_purge(ht, lru, now);
isc_rwlock_t dblock;
dns_db_t *db; /* Locked by dblock */
- unsigned int tid;
+ isc_tid_t tid;
/* Locked */
dns_zonemgr_t *zmgr;
***/
void
-dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx, unsigned int tid) {
+dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx, isc_tid_t tid) {
isc_time_t now;
dns_zone_t *zone = NULL;
dns_zonemgr_createzone(dns_zonemgr_t *zmgr, dns_zone_t **zonep) {
isc_mem_t *mctx = NULL;
dns_zone_t *zone = NULL;
- unsigned int tid;
+ isc_tid_t tid;
REQUIRE(DNS_ZONEMGR_VALID(zmgr));
REQUIRE(zonep != NULL && *zonep == NULL);
*/
isc_loop_t *
-isc_loop_get(isc_loopmgr_t *loopmgr, uint32_t tid);
+isc_loop_get(isc_loopmgr_t *loopmgr, isc_tid_t tid);
/*%<
* Return the loop object associated with the 'tid' threadid
*
*/
void
-isc__nm_force_tid(int tid);
+isc__nm_force_tid(isc_tid_t tid);
/*%<
* Force the thread ID to 'tid'. This is STRICTLY for use in unit
* tests and should not be used in any production code.
#define ISC_REFCOUNT_STATIC_TRACE_DECL(name) \
ISC__REFCOUNT_TRACE_DECL(name, static inline)
-#define ISC__REFCOUNT_TRACE_IMPL(name, destroy, stat) \
- stat name##_t *name##__ref(name##_t *ptr, const char *func, \
- const char *file, unsigned int line) { \
- REQUIRE(ptr != NULL); \
- uint_fast32_t refs = \
- isc_refcount_increment(&ptr->references) + 1; \
- fprintf(stderr, \
- "%s:%s:%s:%u:t%u:%p->references = %" PRIuFAST32 "\n", \
- __func__, func, file, line, isc_tid(), ptr, refs); \
- return (ptr); \
- } \
- \
- stat void name##__unref(name##_t *ptr, const char *func, \
- const char *file, unsigned int line) { \
- REQUIRE(ptr != NULL); \
- uint_fast32_t refs = \
- isc_refcount_decrement(&ptr->references) - 1; \
- if (refs == 0) { \
- isc_refcount_destroy(&ptr->references); \
- destroy(ptr); \
- } \
- fprintf(stderr, \
- "%s:%s:%s:%u:t%u:%p->references = %" PRIuFAST32 "\n", \
- __func__, func, file, line, isc_tid(), ptr, refs); \
- } \
- stat void name##__attach(name##_t *ptr, name##_t **ptrp, \
- const char *func, const char *file, \
- unsigned int line) { \
- REQUIRE(ptrp != NULL && *ptrp == NULL); \
- uint_fast32_t refs = \
- isc_refcount_increment(&ptr->references) + 1; \
- fprintf(stderr, \
- "%s:%s:%s:%u:t%u:%p->references = %" PRIuFAST32 "\n", \
- __func__, func, file, line, isc_tid(), ptr, refs); \
- *ptrp = ptr; \
- } \
- \
- stat void name##__detach(name##_t **ptrp, const char *func, \
- const char *file, unsigned int line) { \
- REQUIRE(ptrp != NULL && *ptrp != NULL); \
- name##_t *ptr = *ptrp; \
- *ptrp = NULL; \
- uint_fast32_t refs = \
- isc_refcount_decrement(&ptr->references) - 1; \
- if (refs == 0) { \
- isc_refcount_destroy(&ptr->references); \
- destroy(ptr); \
- } \
- fprintf(stderr, \
- "%s:%s:%s:%u:t%u:%p->references = %" PRIuFAST32 "\n", \
- __func__, func, file, line, isc_tid(), ptr, refs); \
+#define ISC__REFCOUNT_TRACE_IMPL(name, destroy, stat) \
+ stat name##_t *name##__ref(name##_t *ptr, const char *func, \
+ const char *file, unsigned int line) { \
+ REQUIRE(ptr != NULL); \
+ uint_fast32_t refs = \
+ isc_refcount_increment(&ptr->references) + 1; \
+ fprintf(stderr, \
+ "%s:%s:%s:%u:t%" PRItid \
+ ":%p->references = %" PRIuFAST32 "\n", \
+ __func__, func, file, line, isc_tid(), ptr, refs); \
+ return (ptr); \
+ } \
+ \
+ stat void name##__unref(name##_t *ptr, const char *func, \
+ const char *file, unsigned int line) { \
+ REQUIRE(ptr != NULL); \
+ uint_fast32_t refs = \
+ isc_refcount_decrement(&ptr->references) - 1; \
+ if (refs == 0) { \
+ isc_refcount_destroy(&ptr->references); \
+ destroy(ptr); \
+ } \
+ fprintf(stderr, \
+ "%s:%s:%s:%u:t%" PRItid \
+ ":%p->references = %" PRIuFAST32 "\n", \
+ __func__, func, file, line, isc_tid(), ptr, refs); \
+ } \
+ stat void name##__attach(name##_t *ptr, name##_t **ptrp, \
+ const char *func, const char *file, \
+ unsigned int line) { \
+ REQUIRE(ptrp != NULL && *ptrp == NULL); \
+ uint_fast32_t refs = \
+ isc_refcount_increment(&ptr->references) + 1; \
+ fprintf(stderr, \
+ "%s:%s:%s:%u:t%" PRItid \
+ ":%p->references = %" PRIuFAST32 "\n", \
+ __func__, func, file, line, isc_tid(), ptr, refs); \
+ *ptrp = ptr; \
+ } \
+ \
+ stat void name##__detach(name##_t **ptrp, const char *func, \
+ const char *file, unsigned int line) { \
+ REQUIRE(ptrp != NULL && *ptrp != NULL); \
+ name##_t *ptr = *ptrp; \
+ *ptrp = NULL; \
+ uint_fast32_t refs = \
+ isc_refcount_decrement(&ptr->references) - 1; \
+ if (refs == 0) { \
+ isc_refcount_destroy(&ptr->references); \
+ destroy(ptr); \
+ } \
+ fprintf(stderr, \
+ "%s:%s:%s:%u:t%" PRItid \
+ ":%p->references = %" PRIuFAST32 "\n", \
+ __func__, func, file, line, isc_tid(), ptr, refs); \
}
#define ISC_REFCOUNT_TRACE_IMPL(name, destroy) \
#include <isc/thread.h>
-#define ISC_TID_UNKNOWN UINT32_MAX
+typedef int32_t isc_tid_t;
-uint32_t
+#define PRItid PRId32
+
+#define ISC_TID_UNKNOWN (isc_tid_t) - 1
+
+isc_tid_t
isc_tid_count(void);
/*%<
* Returns the number of threads.
*/
-extern thread_local uint32_t isc__tid_local;
+extern thread_local isc_tid_t isc__tid_local;
-static inline uint32_t
+static inline isc_tid_t
isc_tid(void) {
return isc__tid_local;
}
/* Private */
void
-isc__tid_init(uint32_t tid);
+isc__tid_init(isc_tid_t tid);
void
-isc__tid_initcount(uint32_t count);
+isc__tid_initcount(isc_tid_t count);
#define uv_idle_init(loop, idle) \
({ \
int __r = uv_idle_init(loop, idle); \
- fprintf(stderr, "%" PRIu32 ":%s_:uv_idle_init(%p, %p)\n", \
+ fprintf(stderr, "%" PRItid ":%s_:uv_idle_init(%p, %p)\n", \
isc_tid(), __func__, loop, idle); \
__r; \
})
#define uv_timer_init(loop, timer) \
({ \
int __r = uv_timer_init(loop, timer); \
- fprintf(stderr, "%" PRIu32 ":%s_:uv_timer_init(%p, %p)\n", \
+ fprintf(stderr, "%" PRItid ":%s_:uv_timer_init(%p, %p)\n", \
isc_tid(), __func__, loop, timer); \
__r; \
})
#define uv_async_init(loop, async, async_cb) \
({ \
int __r = uv_async_init(loop, async, async_cb); \
- fprintf(stderr, "%" PRIu32 ":%s_:uv_timer_init(%p, %p, %p)\n", \
+ fprintf(stderr, "%" PRItid ":%s_:uv_timer_init(%p, %p, %p)\n", \
isc_tid(), __func__, loop, async, async_cb); \
__r; \
})
#define uv_close(handle, close_cb) \
({ \
uv_close(handle, close_cb); \
- fprintf(stderr, "%" PRIu32 ":%s_:uv_close(%p, %p)\n", \
+ fprintf(stderr, "%" PRItid ":%s_:uv_close(%p, %p)\n", \
isc_tid(), __func__, handle, close_cb); \
})
}
static void
-loop_init(isc_loop_t *loop, isc_loopmgr_t *loopmgr, uint32_t tid,
+loop_init(isc_loop_t *loop, isc_loopmgr_t *loopmgr, isc_tid_t tid,
const char *kind) {
*loop = (isc_loop_t){
.tid = tid,
/* Start the helper thread */
isc_thread_create(helper_thread, helper, &helper->thread);
- snprintf(name, sizeof(name), "isc-helper-%04" PRIu32, loop->tid);
+ snprintf(name, sizeof(name), "isc-helper-%04" PRItid, loop->tid);
isc_thread_setname(helper->thread, name);
int r = uv_prepare_start(&loop->quiescent, quiescent_cb);
isc_loop_t *loop = &loopmgr->loops[i];
/* Skip current loop */
- if (i == isc_tid()) {
+ if (i == (size_t)isc_tid()) {
continue;
}
}
isc_loop_t *
-isc_loop_get(isc_loopmgr_t *loopmgr, uint32_t tid) {
+isc_loop_get(isc_loopmgr_t *loopmgr, isc_tid_t tid) {
REQUIRE(VALID_LOOPMGR(loopmgr));
- REQUIRE(tid < loopmgr->nloops);
+ REQUIRE((uint32_t)tid < loopmgr->nloops);
return LOOP(loopmgr, tid);
}
isc_loopmgr_t *loopmgr;
uv_loop_t loop;
- uint32_t tid;
+ isc_tid_t tid;
isc_mem_t *mctx;
http_cleanup_listener_endpoints(isc_nmsocket_t *listener);
static isc_nm_http_endpoints_t *
-http_get_listener_endpoints(isc_nmsocket_t *listener, const int tid);
+http_get_listener_endpoints(isc_nmsocket_t *listener, const isc_tid_t tid);
static void
http_initsocket(isc_nmsocket_t *sock);
static void
http_set_endpoints_cb(void *arg) {
http_endpoints_data_t *data = arg;
- const int tid = isc_tid();
+ const isc_tid_t tid = isc_tid();
isc_nmsocket_t *listener = data->listener;
isc_nm_http_endpoints_t *endpoints = data->endpoints;
isc__networker_t *worker = &listener->worker->netmgr->workers[tid];
}
static isc_nm_http_endpoints_t *
-http_get_listener_endpoints(isc_nmsocket_t *listener, const int tid) {
+http_get_listener_endpoints(isc_nmsocket_t *listener, const isc_tid_t tid) {
isc_nm_http_endpoints_t *eps;
REQUIRE(VALID_NMSOCK(listener));
REQUIRE(tid >= 0);
#define gettid() (uint64_t)(pthread_self())
#endif
-#define NETMGR_TRACE_LOG(format, ...) \
- fprintf(stderr, "%" PRIu64 ":%d:%s:%u:%s:" format, gettid(), \
+#define NETMGR_TRACE_LOG(format, ...) \
+ fprintf(stderr, "%" PRIu64 ":%" PRItid ":%s:%u:%s:" format, gettid(), \
isc_tid(), file, line, func, __VA_ARGS__)
#define FLARG \
struct isc_nmsocket {
/*% Unlocked, RO */
int magic;
- uint32_t tid;
+ isc_tid_t tid;
isc_refcount_t references;
isc_nmsocket_type type;
isc__networker_t *worker;
void
isc__nm_async_tls_set_tlsctx(isc_nmsocket_t *listener, isc_tlsctx_t *tlsctx,
- const int tid);
+ const isc_tid_t tid);
void
isc__nmhandle_tls_setwritetimeout(isc_nmhandle_t *handle,
worker->shuttingdown = true;
- isc__netmgr_log(worker->netmgr, ISC_LOG_DEBUG(1),
- "Shutting down network manager worker on loop %p(%d)",
- loop, isc_tid());
+ isc__netmgr_log(
+ worker->netmgr, ISC_LOG_DEBUG(1),
+ "Shutting down network manager worker on loop %p(%" PRItid ")",
+ loop, isc_tid());
uv_walk(&loop->loop, shutdown_walk_cb, NULL);
static void
settlsctx_cb(void *arg) {
settlsctx_data_t *data = arg;
- const uint32_t tid = isc_tid();
+ const isc_tid_t tid = isc_tid();
isc_nmsocket_t *listener = data->listener;
isc_tlsctx_t *tlsctx = data->tlsctx;
isc__networker_t *worker = &listener->worker->netmgr->workers[tid];
worker->netmgr = NULL;
isc__netmgr_log(netmgr, ISC_LOG_DEBUG(1),
- "Destroying network manager worker on loop %p(%d)",
+ "Destroying network manager worker on loop %p(%" PRItid
+ ")",
worker->loop, isc_tid());
isc_loop_detach(&worker->loop);
stop_proxyudp_child_job(void *arg) {
isc_nmsocket_t *listener = NULL;
isc_nmsocket_t *sock = arg;
- uint32_t tid = 0;
+ isc_tid_t tid = 0;
if (sock == NULL) {
return;
isc_nmsocket_t *listensock = (isc_nmsocket_t *)cbarg;
isc_nmsocket_t *nsock;
isc_sockaddr_t iface;
- int tid = isc_tid();
+ isc_tid_t tid = isc_tid();
REQUIRE(VALID_NMHANDLE(handle));
REQUIRE(VALID_NMSOCK(handle->sock));
static void
start_tcp_child(isc_nm_t *mgr, isc_sockaddr_t *iface, isc_nmsocket_t *sock,
- uv_os_sock_t fd, int tid) {
+ uv_os_sock_t fd, isc_tid_t tid) {
isc_nmsocket_t *csock = &sock->children[tid];
isc__networker_t *worker = &mgr->workers[tid];
tls_cleanup_listener_tlsctx(isc_nmsocket_t *listener);
static isc_tlsctx_t *
-tls_get_listener_tlsctx(isc_nmsocket_t *listener, const int tid);
+tls_get_listener_tlsctx(isc_nmsocket_t *listener, const isc_tid_t tid);
static void
tls_keep_client_tls_session(isc_nmsocket_t *sock);
}
static isc_tlsctx_t *
-tls_get_listener_tlsctx(isc_nmsocket_t *listener, const int tid) {
+tls_get_listener_tlsctx(isc_nmsocket_t *listener, const isc_tid_t tid) {
REQUIRE(VALID_NMSOCK(listener));
REQUIRE(tid >= 0);
void
isc__nm_async_tls_set_tlsctx(isc_nmsocket_t *listener, isc_tlsctx_t *tlsctx,
- const int tid) {
+ const isc_tid_t tid) {
REQUIRE(tid >= 0);
isc_tlsctx_free(&listener->tlsstream.listener_tls_ctx[tid]);
static void
start_udp_child(isc_nm_t *mgr, isc_sockaddr_t *iface, isc_nmsocket_t *sock,
- uv_os_sock_t fd, int tid) {
+ uv_os_sock_t fd, isc_tid_t tid) {
isc__networker_t *worker = &mgr->workers[tid];
isc_nmsocket_t *csock = &sock->children[tid];
/**
* Private
*/
-thread_local uint32_t isc__tid_local = ISC_TID_UNKNOWN;
+thread_local isc_tid_t isc__tid_local = ISC_TID_UNKNOWN;
/*
* Zero is a better nonsense value in this case than ISC_TID_UNKNOWN;
* avoids things like trying to allocate 32GB of per-thread counters.
*/
-static uint32_t tid_count = 0;
+static isc_tid_t tid_count = 0;
/**
* Protected
*/
void
-isc__tid_init(uint32_t tid) {
+isc__tid_init(isc_tid_t tid) {
REQUIRE(isc__tid_local == ISC_TID_UNKNOWN || isc__tid_local == tid);
isc__tid_local = tid;
}
void
-isc__tid_initcount(uint32_t count) {
+isc__tid_initcount(isc_tid_t count) {
REQUIRE(tid_count == 0 || tid_count == count);
tid_count = count;
}
* Public
*/
-uint32_t
+isc_tid_t
isc_tid_count(void) {
return tid_count;
}
isc_result_t
ns_clientmgr_create(ns_server_t *sctx, isc_loopmgr_t *loopmgr,
- dns_aclenv_t *aclenv, int tid, ns_clientmgr_t **managerp) {
+ dns_aclenv_t *aclenv, isc_tid_t tid,
+ ns_clientmgr_t **managerp) {
ns_clientmgr_t *manager = NULL;
isc_mem_t *mctx = NULL;
ns_server_t *sctx;
isc_refcount_t references;
- uint32_t tid;
+ isc_tid_t tid;
isc_loop_t *loop;
dns_aclenv_t *aclenv;
isc_result_t
ns_clientmgr_create(ns_server_t *sctx, isc_loopmgr_t *loopmgr,
- dns_aclenv_t *aclenv, int tid, ns_clientmgr_t **managerp);
+ dns_aclenv_t *aclenv, isc_tid_t tid,
+ ns_clientmgr_t **managerp);
/*%<
* Create a client manager.
*/
ns_clientmgr_t *
ns_interfacemgr_getclientmgr(ns_interfacemgr_t *mgr) {
- int tid = isc_tid();
+ isc_tid_t tid = isc_tid();
REQUIRE(NS_INTERFACEMGR_VALID(mgr));
- REQUIRE(tid >= 0);
- REQUIRE((uint32_t)tid < mgr->ncpus);
+ REQUIRE(tid >= 0 && (uint32_t)tid < mgr->ncpus);
return mgr->clientmgrs[tid];
}
#define ZIPF 0
#if VERBOSE
-#define TRACE(fmt, ...) \
- isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_QP, \
- ISC_LOG_DEBUG(7), "%s:%d:%s():t%d: " fmt, __FILE__, \
- __LINE__, __func__, isc_tid(), ##__VA_ARGS__)
+#define TRACE(fmt, ...) \
+ isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_QP, \
+ ISC_LOG_DEBUG(7), "%s:%d:%s():t%" PRItid ": " fmt, \
+ __FILE__, __LINE__, __func__, isc_tid(), ##__VA_ARGS__)
#else
#define TRACE(...)
#endif
dns_dispatchmgr_t *dispatchmgr = NULL;
dns_dispatchset_t *dset = NULL;
dns_dispatch_t *d1, *d2, *d3, *d4, *d5;
- uint32_t tid_saved;
+ isc_tid_t tid_saved;
UNUSED(arg);
static void
async_cb(void *arg) {
- uint32_t tid = isc_tid();
+ isc_tid_t tid = isc_tid();
UNUSED(arg);
static void
async_setup_cb(void *arg) {
- uint32_t tid = isc_loopmgr_nloops(loopmgr) - 1;
+ isc_tid_t tid = isc_loopmgr_nloops(loopmgr) - 1;
isc_loop_t *loop = isc_loop_get(loopmgr, tid);
UNUSED(arg);
fprintf(stderr, "%s:%s:%d:%s = %" PRId64 "\n", __func__, __FILE__, \
__LINE__, #v, atomic_load(&v))
#define P(v) fprintf(stderr, #v " = %" PRId64 "\n", v)
-#define F() \
- fprintf(stderr, "%u:%s(%p, %s, %p)\n", isc_tid(), __func__, handle, \
- isc_result_totext(eresult), cbarg)
+#define F() \
+ fprintf(stderr, "%" PRItid ":%s(%p, %s, %p)\n", isc_tid(), __func__, \
+ handle, isc_result_totext(eresult), cbarg)
#define isc_loopmgr_shutdown(loopmgr) \
{ \
- fprintf(stderr, "%u:%s:%s:%d:isc_loopmgr_shutdown(%p)\n", \
+ fprintf(stderr, \
+ "%" PRItid ":%s:%s:%d:isc_loopmgr_shutdown(%p)\n", \
isc_tid(), __func__, __FILE__, __LINE__, loopmgr); \
isc_loopmgr_shutdown(loopmgr); \
}
atomic_fetch_add(&scheduled, 1);
- assert_int_equal(isc_tid(), UINT32_MAX);
+ assert_int_equal(isc_tid(), ISC_TID_UNKNOWN);
}
static void
static void
work_enqueue_cb(void *arg) {
UNUSED(arg);
- uint32_t tid = isc_loopmgr_nloops(loopmgr) - 1;
+ isc_tid_t tid = isc_loopmgr_nloops(loopmgr) - 1;
isc_loop_t *loop = isc_loop_get(loopmgr, tid);