[Xapian-tickets] [Xapian] #665: Avoid C library functions not guaranteed to be thread-safe
Xapian
nobody at xapian.org
Tue Jun 25 00:21:36 BST 2024
#665: Avoid C library functions not guaranteed to be thread-safe
-------------------------+-------------------------------
Reporter: Olly Betts | Owner: Olly Betts
Type: defect | Status: assigned
Priority: normal | Milestone: 2.0.0
Component: Library API | Version: git master
Severity: normal | Resolution:
Keywords: | Blocked By:
Blocking: | Operating System: All
-------------------------+-------------------------------
Comment (by Olly Betts):
It occurred to me we could perform thread-safe lookup of environment
variables by using `fork()` and looking up the variable in the child
process, then sending the value back to the parent (if it's a small
integer, it could be via the exit code of the child process, otherwise
probably via a pipe).
This clearly has more overhead, but would be fine for e.g. a one-time
check for `XAPIAN_DEBUG_LOG` and `XAPIAN_DEBUG_FLAGS` to initialise debug
logging.
--
Ticket URL: <https://trac.xapian.org/ticket/665#comment:25>
Xapian <https://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list