1 | /* GStreamer |
---|
2 | * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu> |
---|
3 | * |
---|
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. |
---|
8 | * |
---|
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. |
---|
13 | * |
---|
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. |
---|
18 | */ |
---|
19 | |
---|
20 | #ifndef __GST_ATOMIC_H__ |
---|
21 | #define __GST_ATOMIC_H__ |
---|
22 | |
---|
23 | #include <glib.h> |
---|
24 | |
---|
25 | G_BEGIN_DECLS |
---|
26 | |
---|
27 | typedef volatile gint gst_vgint; /* gtk-doc volatile workaround */ |
---|
28 | |
---|
29 | typedef struct _GstAtomicInt GstAtomicInt; |
---|
30 | |
---|
31 | struct _GstAtomicInt { |
---|
32 | gst_vgint counter; |
---|
33 | GMutex *lock; /* for C fallback */ |
---|
34 | }; |
---|
35 | |
---|
36 | |
---|
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); |
---|
44 | |
---|
45 | |
---|
46 | G_END_DECLS |
---|
47 | |
---|
48 | #endif /* __GST_ATOMIC_H__ */ |
---|