mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-29 08:56:15 +01:00
Merge branch 'non-atomic-init' into 'master'
gatomicrefcount: Make g_atomic_ref_count_init non-atomic See merge request GNOME/glib!460
This commit is contained in:
commit
8316ae2241
@ -199,7 +199,7 @@ gboolean
|
|||||||
* g_atomic_ref_count_init:
|
* g_atomic_ref_count_init:
|
||||||
* @arc: the address of an atomic reference count variable
|
* @arc: the address of an atomic reference count variable
|
||||||
*
|
*
|
||||||
* Atomically initializes a reference count variable.
|
* Initializes a reference count variable.
|
||||||
*
|
*
|
||||||
* Since: 2.58
|
* Since: 2.58
|
||||||
*/
|
*/
|
||||||
@ -217,7 +217,7 @@ void
|
|||||||
* Acquiring a reference moves us towards MAXINT, and releasing a
|
* Acquiring a reference moves us towards MAXINT, and releasing a
|
||||||
* reference moves us towards 0.
|
* reference moves us towards 0.
|
||||||
*/
|
*/
|
||||||
g_atomic_int_set (arc, 1);
|
*arc = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -92,7 +92,7 @@ gboolean g_atomic_ref_count_compare (gatomicrefcount *arc,
|
|||||||
(G_GNUC_EXTENSION ({ \
|
(G_GNUC_EXTENSION ({ \
|
||||||
G_STATIC_ASSERT (sizeof *(rc) == sizeof (gatomicrefcount)); \
|
G_STATIC_ASSERT (sizeof *(rc) == sizeof (gatomicrefcount)); \
|
||||||
(void) (0 ? *(rc) ^ *(rc) : 1); \
|
(void) (0 ? *(rc) ^ *(rc) : 1); \
|
||||||
g_atomic_int_set ((rc), 1); \
|
*(rc) = 1; \
|
||||||
}))
|
}))
|
||||||
|
|
||||||
# define g_atomic_ref_count_inc(rc) \
|
# define g_atomic_ref_count_inc(rc) \
|
||||||
|
Loading…
Reference in New Issue
Block a user