]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/threads-aware.xml
ci(lint): temporarily disable ShellCheck for bash-completion
[thirdparty/systemd.git] / man / threads-aware.xml
CommitLineData
64a7ef8b 1<?xml version="1.0"?>
bbd0645a 2<!DOCTYPE refsect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3a54a157 3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
db9ecf05 4<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
64a7ef8b
LP
5
6<refsect1>
af355f19 7 <title/>
64a7ef8b 8
7e59b569
DT
9 <para id="strict">All functions listed here are thread-agnostic and only a single specific thread may operate on a
10 given object during its entire lifetime. It's safe to allocate multiple independent objects and use each from a
11 specific thread in parallel. However, it's not safe to allocate such an object in one thread, and operate or free it
12 from any other, even if locking is used to ensure these threads don't operate on it at the very same time.</para>
64a7ef8b 13
7e59b569 14 <para id="safe">All functions listed here are thread-safe and may be called in parallel from multiple threads.</para>
64a7ef8b 15
7e59b569
DT
16 <para id='getenv'>The code described here uses
17 <citerefentry project='man-pages'><refentrytitle>getenv</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
18 which is declared to be not multi-thread-safe. This means that the code calling the functions described
19 here must not call
20 <citerefentry project='man-pages'><refentrytitle>setenv</refentrytitle><manvolnum>3</manvolnum></citerefentry>
21 from a parallel thread. It is recommended to only do calls to <function>setenv()</function>
22 from an early phase of the program when no other threads have been started.</para>
8c51e152 23
64a7ef8b 24</refsect1>