GstAtomic
Name
GstAtomic -- Functions that implement atomic operations.
Description
Functions that implement atomic operations on a GstAtomicInt structure.
Atomic operations are thread safe and don't use heavyweight locking mechanisms.
These functions will be inlined in the GStreamer core but are available to plugins
as external methods.
Details
struct GstAtomicInt
struct GstAtomicInt {
volatile gint counter;
GMutex *lock; /* for C fallback */
}; |
A structure that contains an integer that can be modified
atomically.
gst_atomic_int_init ()
Initialize an allocated GstAtomicInt with a value. Call this method
only once as it will allocate a mutex in the C-fallback case.
gst_atomic_int_destroy ()
Destroy a GstAtomicInt. Call this method only once as it will
free the mutex in the C-fallback case.
gst_atomic_int_set ()
Atomically set the value on the GstAtomicInt.
gst_atomic_int_read ()
Atomically read the contents of a GstAtomicInt
gst_atomic_int_add ()
Atomically add the given value to the GstAtomicInt.
gst_atomic_int_dec_and_test ()
Atomically decrement the GstAtomicInt and test if it is zero.