2002-12-14 16:22:01 +00:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
|
|
|
GstAtomic
|
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
2003-01-02 18:56:09 +00:00
|
|
|
Functions that implement atomic operations.
|
2002-12-14 16:22:01 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
|
|
<para>
|
2003-01-02 18:56:09 +00:00
|
|
|
Functions that implement atomic operations on a #GstAtomicInt structure.
|
|
|
|
Atomic operations are thread safe and don't use heavyweight locking mechanisms.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
These functions will be inlined in the GStreamer core but are available to plugins
|
|
|
|
as external methods.
|
2002-12-14 16:22:01 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
|
|
<para>
|
|
|
|
#GstMemChunk
|
|
|
|
</para>
|
|
|
|
|
2004-03-25 04:20:33 +00:00
|
|
|
<!-- ##### TYPEDEF gst_vgint ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
2002-12-14 16:22:01 +00:00
|
|
|
<!-- ##### STRUCT GstAtomicInt ##### -->
|
|
|
|
<para>
|
|
|
|
A structure that contains an integer that can be modified
|
|
|
|
atomically.
|
|
|
|
</para>
|
|
|
|
|
2003-06-29 14:57:19 +00:00
|
|
|
@counter:
|
2003-01-02 18:56:09 +00:00
|
|
|
@lock:
|
2002-12-14 16:22:01 +00:00
|
|
|
|
2003-01-02 18:56:09 +00:00
|
|
|
<!-- ##### FUNCTION gst_atomic_int_init ##### -->
|
2002-12-14 16:22:01 +00:00
|
|
|
<para>
|
2003-01-02 18:56:09 +00:00
|
|
|
Initialize an allocated #GstAtomicInt with a value. Call this method
|
|
|
|
only once as it will allocate a mutex in the C-fallback case.
|
2002-12-14 16:22:01 +00:00
|
|
|
</para>
|
|
|
|
|
2003-01-02 18:56:09 +00:00
|
|
|
@aint: a #GstAtomicInt
|
|
|
|
@val: a new value
|
2002-12-14 16:22:01 +00:00
|
|
|
|
|
|
|
|
2003-01-02 18:56:09 +00:00
|
|
|
<!-- ##### FUNCTION gst_atomic_int_destroy ##### -->
|
2002-12-14 16:22:01 +00:00
|
|
|
<para>
|
2003-01-02 18:56:09 +00:00
|
|
|
Destroy a #GstAtomicInt. Call this method only once as it will
|
|
|
|
free the mutex in the C-fallback case.
|
2002-12-14 16:22:01 +00:00
|
|
|
</para>
|
|
|
|
|
2003-01-02 18:56:09 +00:00
|
|
|
@aint: a #GstAtomicInt
|
2002-12-14 16:22:01 +00:00
|
|
|
|
|
|
|
|
2003-01-02 18:56:09 +00:00
|
|
|
<!-- ##### FUNCTION gst_atomic_int_set ##### -->
|
2002-12-14 16:22:01 +00:00
|
|
|
<para>
|
2003-01-02 18:56:09 +00:00
|
|
|
Atomically set the value on the #GstAtomicInt.
|
2002-12-14 16:22:01 +00:00
|
|
|
</para>
|
|
|
|
|
2003-01-02 18:56:09 +00:00
|
|
|
@aint: a #GstAtomicInt
|
|
|
|
@val: The new value
|
2002-12-14 16:22:01 +00:00
|
|
|
|
|
|
|
|
2003-01-02 18:56:09 +00:00
|
|
|
<!-- ##### FUNCTION gst_atomic_int_read ##### -->
|
2002-12-14 16:22:01 +00:00
|
|
|
<para>
|
2003-01-02 18:56:09 +00:00
|
|
|
Atomically read the contents of a #GstAtomicInt
|
2002-12-14 16:22:01 +00:00
|
|
|
</para>
|
|
|
|
|
2003-01-02 18:56:09 +00:00
|
|
|
@aint: a #GstAtomicInt
|
|
|
|
@Returns: the value of the atomic int
|
2002-12-14 16:22:01 +00:00
|
|
|
|
|
|
|
|
2003-01-02 18:56:09 +00:00
|
|
|
<!-- ##### FUNCTION gst_atomic_int_add ##### -->
|
2002-12-14 16:22:01 +00:00
|
|
|
<para>
|
2003-01-02 18:56:09 +00:00
|
|
|
Atomically add the given value to the #GstAtomicInt.
|
2002-12-14 16:22:01 +00:00
|
|
|
</para>
|
|
|
|
|
2003-01-02 18:56:09 +00:00
|
|
|
@aint: a #GstAtomicInt
|
|
|
|
@val: the value to add
|
2002-12-14 16:22:01 +00:00
|
|
|
|
|
|
|
|
2003-01-02 18:56:09 +00:00
|
|
|
<!-- ##### FUNCTION gst_atomic_int_inc ##### -->
|
2002-12-14 16:22:01 +00:00
|
|
|
<para>
|
2003-01-02 18:56:09 +00:00
|
|
|
Atomically increment the #GstAtomicInt
|
2002-12-14 16:22:01 +00:00
|
|
|
</para>
|
|
|
|
|
2003-01-02 18:56:09 +00:00
|
|
|
@aint: a #GstAtomicInt
|
2002-12-14 16:22:01 +00:00
|
|
|
|
|
|
|
|
2003-01-02 18:56:09 +00:00
|
|
|
<!-- ##### FUNCTION gst_atomic_int_dec_and_test ##### -->
|
2002-12-14 16:22:01 +00:00
|
|
|
<para>
|
2003-01-02 18:56:09 +00:00
|
|
|
Atomically decrement the #GstAtomicInt and test if it is zero.
|
2002-12-14 16:22:01 +00:00
|
|
|
</para>
|
|
|
|
|
2003-01-02 18:56:09 +00:00
|
|
|
@aint: a #GstAtomicInt
|
|
|
|
@Returns: TRUE if the atomic int is 0
|
2002-12-14 16:22:01 +00:00
|
|
|
|
|
|
|
|