isc_result_t
isc_thread_setaffinity(int cpu);
-#define isc_thread_self (unsigned long)pthread_self
+#define isc_thread_self (uintptr_t) pthread_self
ISC_LANG_ENDDECLS
static void
print_lock(const char *operation, isc_rwlock_t *rwl, isc_rwlocktype_t type) {
fprintf(stderr,
- "rwlock %p thread %lu %s(%s): "
+ "rwlock %p thread %" PRIuPTR " %s(%s): "
"write_requests=%u, write_completions=%u, "
"cnt_and_flag=0x%x, readers_waiting=%u, "
"write_granted=%u, write_quota=%u\n",
*/
#ifdef ISC_TASK_TRACE
-#define XTRACE(m) \
- fprintf(stderr, "task %p thread %lu: %s\n", task, isc_thread_self(), \
- (m))
-#define XTTRACE(t, m) \
- fprintf(stderr, "task %p thread %lu: %s\n", (t), isc_thread_self(), (m))
+#define XTRACE(m) \
+ fprintf(stderr, "task %p thread %" PRIuPTR ": %s\n", task, \
+ isc_thread_self(), (m))
+#define XTTRACE(t, m) \
+ fprintf(stderr, "task %p thread %" PRIuPTR ": %s\n", (t), \
+ isc_thread_self(), (m))
#define XTHREADTRACE(m) \
- fprintf(stderr, "thread %lu: %s\n", isc_thread_self(), (m))
+ fprintf(stderr, "thread %" PRIuPTR ": %s\n", isc_thread_self(), (m))
#else /* ifdef ISC_TASK_TRACE */
#define XTRACE(m)
#define XTTRACE(t, m)
struct isc__trampoline {
int tid; /* const */
- isc_thread_t self;
+ uintptr_t self;
isc_threadfunc_t start;
isc_threadarg_t arg;
};
}
static isc_result_t
-find_thread_condition(unsigned long thrd, isc_condition_t *cond,
+find_thread_condition(uintptr_t thrd, isc_condition_t *cond,
isc_condition_thread_t **threadcondp) {
isc_condition_thread_t *threadcond;
typedef struct isc_condition_thread isc_condition_thread_t;
struct isc_condition_thread {
- unsigned long th;
- HANDLE handle[2];
+ uintptr_t th;
+ HANDLE handle[2];
ISC_LINK(isc_condition_thread_t) link;
};
#ifndef ISC_THREAD_H
#define ISC_THREAD_H 1
+#include <inttypes.h>
#include <windows.h>
#include <isc/lang.h>
typedef void * isc_threadarg_t;
typedef isc_threadresult_t(WINAPI *isc_threadfunc_t)(isc_threadarg_t);
-#define isc_thread_self (unsigned long)GetCurrentThreadId
+#define isc_thread_self (uintptr_t) GetCurrentThreadId
ISC_LANG_BEGINDECLS
sizeof(tbuf));
isc_log_write(ns_lctx, NS_LOGCATEGORY_CLIENT,
NS_LOGMODULE_QUERY, level,
- "query client=%p thread=0x%lx "
+ "query client=%p thread=0x%" PRIxPTR
"(%s/%s): %s",
- client, (unsigned long)isc_thread_self(),
- qbuf, tbuf, message);
+ client, isc_thread_self(), qbuf, tbuf,
+ message);
}
} else {
isc_log_write(ns_lctx, NS_LOGCATEGORY_CLIENT,
NS_LOGMODULE_QUERY, level,
- "query client=%p thread=0x%lx "
+ "query client=%p thread=0x%" PRIxPTR
"(<unknown-query>): %s",
- client, (unsigned long)isc_thread_self(),
- message);
+ client, isc_thread_self(), message);
}
}
#define CTRACE(l, m) client_trace(client, l, m)