mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-13 12:37:46 +02:00
build
debian
docs
gio
glib
gmodule
gobject
tests
.gitignore
ChangeLog
Makefile.am
abicheck.sh
gatomicarray.c
gatomicarray.h
gbinding.c
gbinding.h
gboxed.c
gboxed.h
gclosure.c
gclosure.h
genums.c
genums.h
glib-genmarshal.c
glib-mkenums.in
glib-types.h
gmarshal.c
gmarshal.h
gmarshal.list
gobject-query.c
gobject.c
gobject.h
gobject.py
gobject.rc.in
gobject.stp.in
gobject.symbols
gobject_probes.d
gobject_trace.h
gobjectnotifyqueue.c
gparam.c
gparam.h
gparamspecs.c
gparamspecs.h
gsignal.c
gsignal.h
gsourceclosure.c
gsourceclosure.h
gtype-private.h
gtype.c
gtype.h
gtypemodule.c
gtypemodule.h
gtypeplugin.c
gtypeplugin.h
gvalue.c
gvalue.h
gvaluearray.c
gvaluearray.h
gvaluecollector.h
gvaluetransform.c
gvaluetypes.c
gvaluetypes.h
libgobject-gdb.py.in
makefile.msc.in
marshal-genstrings.pl
testgobject.c
gthread
m4macros
po
tests
.gitignore
AUTHORS
COPYING
ChangeLog.pre-1-2
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-14
ChangeLog.pre-2-16
ChangeLog.pre-2-18
ChangeLog.pre-2-2
ChangeLog.pre-2-20
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
HACKING
INSTALL.in
Makefile.am
Makefile.decl
NEWS
NEWS.pre-1-3
README.commits
README.in
README.win32
acglib.m4
acinclude.m4
autogen.sh
config.h.win32.in
configure.ac
gio-2.0-uninstalled.pc.in
gio-2.0.pc.in
gio-unix-2.0-uninstalled.pc.in
gio-unix-2.0.pc.in
gio-windows-2.0.pc.in
glib-2.0-uninstalled.pc.in
glib-2.0.pc.in
glib-gettextize.in
glib-zip.in
glib.doap
gmodule-2.0-uninstalled.pc.in
gmodule-2.0.pc.in
gmodule-export-2.0.pc.in
gmodule-no-export-2.0-uninstalled.pc.in
gmodule-no-export-2.0.pc.in
gobject-2.0-uninstalled.pc.in
gobject-2.0.pc.in
gthread-2.0-uninstalled.pc.in
gthread-2.0.pc.in
makefile.msc
mkinstalldirs
msvc_recommended_pragmas.h
sanity_check
win32-fixup.pl
61 lines
2.1 KiB
C
61 lines
2.1 KiB
C
![]() |
/* GObject - GLib Type, Object, Parameter and Signal Library
|
||
|
* Copyright (C) 2009 Benjamin Otte <otte@gnome.org>
|
||
|
*
|
||
|
* This library is free software; you can redistribute it and/or
|
||
|
* modify it under the terms of the GNU Lesser General Public
|
||
|
* License as published by the Free Software Foundation; either
|
||
|
* version 2 of the License, or (at your option) any later version.
|
||
|
*
|
||
|
* This library is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
* Lesser General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU Lesser General
|
||
|
* Public License along with this library; if not, write to the
|
||
|
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||
|
* Boston, MA 02111-1307, USA.
|
||
|
*/
|
||
|
#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
|
||
|
#error "Only <glib-object.h> can be included directly."
|
||
|
#endif
|
||
|
|
||
|
#ifndef __G_ATOMIC_ARRAY_H__
|
||
|
#define __G_ATOMIC_ARRAY_H__
|
||
|
|
||
|
#include <glib/glib.h>
|
||
|
|
||
|
G_BEGIN_DECLS
|
||
|
|
||
|
#define G_ATOMIC_ARRAY_DATA_SIZE(mem) (*((gsize *) (mem) - 1))
|
||
|
|
||
|
typedef struct _GAtomicArray GAtomicArray;
|
||
|
struct _GAtomicArray {
|
||
|
volatile gpointer data; /* elements - atomic */
|
||
|
};
|
||
|
|
||
|
void _g_atomic_array_init (GAtomicArray *array);
|
||
|
gpointer _g_atomic_array_copy (GAtomicArray *array,
|
||
|
gsize header_size,
|
||
|
gsize additional_element_size);
|
||
|
void _g_atomic_array_update (GAtomicArray *array,
|
||
|
gpointer new_data);
|
||
|
|
||
|
#define G_ATOMIC_ARRAY_GET_LOCKED(_array, _type) ((_type *)((_array)->data))
|
||
|
|
||
|
#define G_ATOMIC_ARRAY_DO_TRANSACTION(_array, _type, _C_) G_STMT_START { \
|
||
|
volatile gpointer *_datap = &(_array)->data; \
|
||
|
_type *transaction_data, *__check; \
|
||
|
\
|
||
|
__check = g_atomic_pointer_get (_datap); \
|
||
|
do { \
|
||
|
transaction_data = __check; \
|
||
|
{_C_;} \
|
||
|
__check = g_atomic_pointer_get (_datap); \
|
||
|
} while (transaction_data != __check); \
|
||
|
} G_STMT_END
|
||
|
|
||
|
G_END_DECLS
|
||
|
|
||
|
#endif /* __G_ATOMIC_ARRAY_H__ */
|