The isc_tid() function is often called on the hot-path and it's the only
function is to return thread_local variable, make the isc_tid() function
a header-only to save several function calls during query-response
processing.
- find bin lib -maxdepth 1 -mindepth 1 -type d -exec cp -f lib/isc/include/isc/buffer.h "{}" \;
- cp -f lib/isc/include/isc/buffer.h lib/isc/netmgr/buffer.h
- cp -f lib/isc/include/isc/dnsstream.h lib/isc/netmgr/dnsstream.h
+ - cp -f lib/isc/include/isc/tid.h lib/isc/netmgr/tid.h
# Help gcovr find dlz_dbi.c file
- for DST in ldap mysql mysqldyn sqlite3 wildcard; do cp contrib/dlz/modules/common/dlz_dbi.c "contrib/dlz/modules/${DST}"; done
# Generate XML file in the Cobertura XML format suitable for use by GitLab
#include <inttypes.h>
#include <isc/lang.h>
+#include <isc/thread.h>
ISC_LANG_BEGINDECLS
* Returns the number of threads.
*/
-uint32_t
-isc_tid(void);
+extern thread_local uint32_t tid_local;
+
+static inline uint32_t
+isc_tid(void) {
+ return (tid_local);
+}
/*%<
* Returns the thread ID of the currently-running loop.
*/
/**
* Private
*/
-
-#define ISC_TID_UNKNOWN UINT32_MAX
-
-static thread_local uint32_t tid_local = ISC_TID_UNKNOWN;
+thread_local uint32_t tid_local = ISC_TID_UNKNOWN;
/*
* Zero is a better nonsense value in this case than ISC_TID_UNKNOWN;
* Public
*/
-uint32_t
-isc_tid(void) {
- return (tid_local);
-}
-
uint32_t
isc_tid_count(void) {
return (tid_count);