jpayne@68: .\" jpayne@68: .\" Copyright 2023 by the c-ares project and its contributors jpayne@68: .\" SPDX-License-Identifier: MIT jpayne@68: .\" jpayne@68: .TH ARES_THREADSAFETY 3 "26 November 2023" jpayne@68: .SH NAME jpayne@68: ares_threadsafety \- Query if c-ares was built with thread-safety jpayne@68: .SH SYNOPSIS jpayne@68: .nf jpayne@68: #include jpayne@68: jpayne@68: ares_bool_t ares_threadsafety(void); jpayne@68: .fi jpayne@68: .SH DESCRIPTION jpayne@68: The \fBares_threadsafety(3)\fP function returns if the library was built with jpayne@68: thread safety enabled or not. jpayne@68: jpayne@68: As of c-ares 1.23.0, this simply means that every public function which jpayne@68: references an \fIares_channel_t\fP object will lock the channel on entry and jpayne@68: release the lock on exit of the function. This will prevent concurrent jpayne@68: thread access to the channel, thus ensuring no corruption can occur. jpayne@68: jpayne@68: As of c-ares 1.26.0, this also indicates if \fBARES_OPT_EVENT_THREAD\fP can jpayne@68: be passed to \fIares_init_options(3)\fP. jpayne@68: jpayne@68: .SH RETURN VALUES jpayne@68: \fIares_threadsafety(3)\fP can return any of the following values: jpayne@68: .TP 14 jpayne@68: .B ARES_TRUE jpayne@68: Built with thread safety. jpayne@68: .TP 14 jpayne@68: .B ARES_FALSE jpayne@68: Built without thread safety jpayne@68: .TP 14 jpayne@68: jpayne@68: .SH AVAILABILITY jpayne@68: This function was first introduced in c-ares version 1.23.0. jpayne@68: .SH SEE ALSO jpayne@68: .BR ares_init (3), jpayne@68: .BR ares_init_options (3), jpayne@68: .BR ares_destroy (3), jpayne@68: .BR ares_dup (3), jpayne@68: .BR ares_library_init (3), jpayne@68: .BR ares_set_servers (3)