X-Git-Url: https://git.distorted.org.uk/~mdw/adns/blobdiff_plain/ae8cc9775a6eb23901a89a2604f73525b0553db8..8de0fa76b3e27b4a96db5c77415962117650afa7:/src/adns.h diff --git a/src/adns.h b/src/adns.h index befa0b3..a903934 100644 --- a/src/adns.h +++ b/src/adns.h @@ -1,6 +1,6 @@ /* * adns.h - * - adns user-visible API (single-threaded, without any locking) + * - adns user-visible API */ /* * @@ -401,6 +401,18 @@ typedef struct { * requested. */ +/* Threads: + * adns does not use any static modifiable state, so it + * is safe to call adns_init several times and then use the + * resulting adns_states concurrently. + * However, it is NOT safe to make simultaneous calls into + * adns using the same adns_state; a single adns_state must be used + * only by one thread at a time. You can solve this problem by + * having one adns_state per thread, or if that isn't feasible, you + * could maintain a pool of adns_states. Unfortunately neither of + * these approaches has optimal performance. + */ + int adns_init(adns_state *newstate_r, adns_initflags flags, FILE *diagfile /*0=>stderr*/);