thread safety enhancements

v1.23
Brad House 8 months ago
parent 2b5315c467
commit 1c5b60fa1e
  1. 5
      docs/ares_init_options.3
  2. 2
      src/lib/ares_private.h

@ -216,8 +216,9 @@ The value of
.I sock_state_cb_data
will be passed as the
.I data
argument. Since this may be called cross-thread, a channel lock is NOT held
when this callback is called.
argument. The channel lock is held during this callback, if calling
cross-thread care must be taken to ensure no other c-ares functions are
called from this callback.
.TP 18
.B ARES_OPT_SORTLIST
.B struct apattern *\fIsortlist\fP;

@ -563,9 +563,7 @@ ares_status_t ares__dns_name_write(ares__buf_t *buf, ares__llist_t **list,
#define SOCK_STATE_CALLBACK(c, s, r, w) \
do { \
if ((c)->sock_state_cb) { \
ares__channel_unlock((c)); \
(c)->sock_state_cb((c)->sock_state_cb_data, (s), (r), (w)); \
ares__channel_lock((c)); \
} \
} while (0)

Loading…
Cancel
Save