2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef __GST_ATOMIC_H__
21 #define __GST_ATOMIC_H__
27 typedef volatile gint gst_vgint; /* gtk-doc volatile workaround */
29 typedef struct _GstAtomicInt GstAtomicInt;
31 struct _GstAtomicInt {
33 GMutex *lock; /* for C fallback */
37 void gst_atomic_int_init (GstAtomicInt *aint, gint val);
38 void gst_atomic_int_destroy (GstAtomicInt *aint);
39 void gst_atomic_int_set (GstAtomicInt *aint, gint val);
40 gint gst_atomic_int_read (GstAtomicInt *aint);
41 void gst_atomic_int_add (GstAtomicInt *aint, gint val);
42 void gst_atomic_int_inc (GstAtomicInt *aint);
43 gboolean gst_atomic_int_dec_and_test (GstAtomicInt *aint);
48 #endif /* __GST_ATOMIC_H__ */