sd-event: add sd_event_source_disable_unrefp() too
I do not have any immediate use for it, but let's add it for completeness.
This commit is contained in:
parent
afd15bbb4b
commit
aa7585fd8e
|
@ -446,6 +446,7 @@ manpages = [
|
||||||
['sd_event_source_unref',
|
['sd_event_source_unref',
|
||||||
'3',
|
'3',
|
||||||
['sd_event_source_disable_unref',
|
['sd_event_source_disable_unref',
|
||||||
|
'sd_event_source_disable_unrefp',
|
||||||
'sd_event_source_ref',
|
'sd_event_source_ref',
|
||||||
'sd_event_source_unrefp'],
|
'sd_event_source_unrefp'],
|
||||||
''],
|
''],
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
<refname>sd_event_source_unrefp</refname>
|
<refname>sd_event_source_unrefp</refname>
|
||||||
<refname>sd_event_source_ref</refname>
|
<refname>sd_event_source_ref</refname>
|
||||||
<refname>sd_event_source_disable_unref</refname>
|
<refname>sd_event_source_disable_unref</refname>
|
||||||
|
<refname>sd_event_source_disable_unrefp</refname>
|
||||||
|
|
||||||
<refpurpose>Increase or decrease event source reference counters</refpurpose>
|
<refpurpose>Increase or decrease event source reference counters</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
|
@ -47,6 +48,11 @@
|
||||||
<funcdef>sd_event_source* <function>sd_event_source_disable_unref</function></funcdef>
|
<funcdef>sd_event_source* <function>sd_event_source_disable_unref</function></funcdef>
|
||||||
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
|
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
|
||||||
</funcprototype>
|
</funcprototype>
|
||||||
|
|
||||||
|
<funcprototype>
|
||||||
|
<funcdef>void <function>sd_event_source_disable_unrefp</function></funcdef>
|
||||||
|
<paramdef>sd_event_source **<parameter>source</parameter></paramdef>
|
||||||
|
</funcprototype>
|
||||||
</funcsynopsis>
|
</funcsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
@ -94,6 +100,12 @@
|
||||||
<function>sd_event_source_unref()</function>. This ensures that the source is disabled before the local
|
<function>sd_event_source_unref()</function>. This ensures that the source is disabled before the local
|
||||||
reference to it is lost. The <parameter>source</parameter> parameter is allowed to be
|
reference to it is lost. The <parameter>source</parameter> parameter is allowed to be
|
||||||
<constant>NULL</constant>.</para>
|
<constant>NULL</constant>.</para>
|
||||||
|
|
||||||
|
<para><function>sd_event_source_disable_unrefp()</function> is similar to
|
||||||
|
<function>sd_event_source_unrefp()</function>, but in addition disables the source first. This call is
|
||||||
|
useful in conjunction with GCC's and LLVM's
|
||||||
|
<ulink url="https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html">Clean-up Variable
|
||||||
|
Attribute</ulink>. Note that this function is defined as inline function.</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
|
|
|
@ -150,6 +150,7 @@ int sd_event_source_set_floating(sd_event_source *s, int b);
|
||||||
/* Define helpers so that __attribute__((cleanup(sd_event_unrefp))) and similar may be used. */
|
/* Define helpers so that __attribute__((cleanup(sd_event_unrefp))) and similar may be used. */
|
||||||
_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_event, sd_event_unref);
|
_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_event, sd_event_unref);
|
||||||
_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_event_source, sd_event_source_unref);
|
_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_event_source, sd_event_source_unref);
|
||||||
|
_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_event_source, sd_event_source_disable_unref);
|
||||||
|
|
||||||
_SD_END_DECLARATIONS;
|
_SD_END_DECLARATIONS;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue